OSDN Git Service

サンプルがタッチキーボードで正常に動いてなかった
authorgdkhd812 <test@yahoo.co.jp>
Mon, 27 Feb 2017 05:59:10 +0000 (14:59 +0900)
committergdkhd812 <test@yahoo.co.jp>
Mon, 27 Feb 2017 05:59:10 +0000 (14:59 +0900)
UWP/Test/MainPage.xaml
UWP/Test/MainPage.xaml.cs
UWP/Test/Test.csproj

index 1d73ed9..cb6115a 100644 (file)
@@ -24,6 +24,6 @@
             <Button Content="Load" Click="Button_Click"/>
             <Button Content="Print" Click="Print_Button_Click"/>
         </StackPanel>
-        <foo:FooTextBox  Grid.Row="1" Name="fooTextBox" Document="{Binding CurrentDocument,Mode=TwoWay}"></foo:FooTextBox>
+        <foo:FooTextBox  Grid.Row="1" Name="fooTextBox" Document="{Binding CurrentDocument,Mode=TwoWay}" AllowFocusOnInteraction="True"></foo:FooTextBox>
     </Grid>
 </Page>
index 14fe239..995d4af 100644 (file)
@@ -6,6 +6,7 @@ using Windows.Foundation;
 using Windows.UI.Core;
 using Windows.UI.Xaml;
 using Windows.UI.Xaml.Controls;
+using Windows.UI.ViewManagement;
 using Windows.Storage;
 using Windows.Storage.Pickers;
 using Windows.Graphics.Printing;
@@ -27,7 +28,23 @@ namespace Test
             this.InitializeComponent();
             this.DataContext = this.vm;
             this.fooTextBox.Document = this.vm.CurrentDocument;
+            //this.fooTextBox.AllowFocusOnInteraction = true;
             PrintManager.GetForCurrentView().PrintTaskRequested += MainPage_PrintTaskRequested;
+            InputPane currentView = InputPane.GetForCurrentView();
+            currentView.Showing += currentView_Showing;
+            currentView.Hiding += currentView_Hiding;
+        }
+
+        void currentView_Hiding(InputPane sender, InputPaneVisibilityEventArgs args)
+        {
+            this.fooTextBox.Margin = new Thickness(0);
+            args.EnsuredFocusedElementInView = true;
+        }
+
+        void currentView_Showing(InputPane sender, InputPaneVisibilityEventArgs args)
+        {
+            this.fooTextBox.Margin = new Thickness(0, 0, 0, args.OccludedRect.Height);
+            args.EnsuredFocusedElementInView = true;
         }
 
         void MainPage_PrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs args)
index ad024e2..ee4a61f 100644 (file)
@@ -12,7 +12,7 @@
     <DefaultLanguage>ja-JP</DefaultLanguage>
     <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
     <TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
-    <TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
+    <TargetPlatformMinVersion>10.0.14393.0</TargetPlatformMinVersion>
     <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>