OSDN Git Service

Visibility.CollapsedがVisibilityに設定されているにも関わらず、描写されてしまう不具合を修正した
authorkonekoneko <test2214@hotmail.co.jp>
Sun, 9 Mar 2014 07:39:53 +0000 (16:39 +0900)
committerkonekoneko <test2214@hotmail.co.jp>
Sun, 9 Mar 2014 07:39:53 +0000 (16:39 +0900)
Metro/FooEditEngine/FooTextBox.cs
Metro/Test/AppSettings.cs
Metro/Test/MainPage.xaml.cs
Metro/Test/SettingsFlyout.xaml
WPF/FooEditEngine/FooTextBox.cs

index 22ac9a8..3f76473 100644 (file)
@@ -953,6 +953,7 @@ namespace FooEditEngine.Metro
             if (this.peer != null)\r
                 this.peer.OnNotifyCaretChanged();\r
             this.View.IsFocused = true;\r
+            this.Focus(FocusState.Programmatic);\r
             this.Refresh();\r
         }\r
 \r
@@ -976,7 +977,7 @@ namespace FooEditEngine.Metro
         }\r
         void Refresh(Rectangle updateRect)\r
         {\r
-            if (this.rectangle.ActualWidth == 0 || this.rectangle.ActualHeight == 0/* || !this.Render.IsCanDraw()*/)\r
+            if (this.rectangle.ActualWidth == 0 || this.rectangle.ActualHeight == 0 || this.Visibility == Windows.UI.Xaml.Visibility.Collapsed)\r
                 return;\r
 \r
             this.Render.BegineDraw();\r
@@ -1163,7 +1164,7 @@ namespace FooEditEngine.Metro
             {\r
                 source.View.HideRuler = !source.DrawRuler;\r
                 source._Controller.JumpCaret(source.View.CaretPostion.row, source.View.CaretPostion.col);\r
-            }            \r
+            }\r
         }\r
         #endregion\r
 \r
index 38224ba..320bee5 100644 (file)
@@ -37,7 +37,7 @@ namespace Test
             }\r
         }\r
 \r
-        bool _IsRTL, _ShowRuler, _ShowLineNumber, _ShowLineMarker, _HilightXML;\r
+        bool _IsRTL, _ShowRuler, _ShowLineNumber, _ShowLineMarker, _HilightXML, _IsVisible = true;\r
         ObservableCollection<LineBreakMethodItem> _LineBreakMethodList;\r
         LineBreakMethodItem _CurrentLineBreakMethod;\r
 \r
@@ -63,6 +63,20 @@ namespace Test
             }\r
         }\r
 \r
+        public bool IsVisible\r
+        {\r
+            get\r
+            {\r
+                return this._IsVisible;\r
+            }\r
+            set\r
+            {\r
+                this._IsVisible = value;\r
+                if (ChangedSetting != null)\r
+                    ChangedSetting(this, null);\r
+            }\r
+        }\r
+\r
         public bool IsRTL\r
         {\r
             get\r
index 1ceeeed..5042971 100644 (file)
@@ -90,6 +90,7 @@ namespace Test
                 this.fooTextBox.Hilighter = null;\r
                 this.fooTextBox.LayoutLineCollection.ClearHilight();\r
             }\r
+            this.fooTextBox.Visibility = setting.IsVisible ? Visibility.Visible : Visibility.Collapsed;\r
             this.fooTextBox.LineBreakMethod = setting.CurrentLineBreakMethod.Method;\r
             this.fooTextBox.LineBreakCharCount = 50;\r
             this.fooTextBox.Refresh();\r
index a7a2bfe..c2f2c5a 100644 (file)
@@ -16,6 +16,7 @@
         <ToggleSwitch Margin="-6, 0, 0, 0" IsOn="{Binding ShowLineNumber,Mode=TwoWay}" Header = "行番号を表示する" HorizontalAlignment="Stretch"/>\r
         <ToggleSwitch Margin="-6, 0, 0, 0" IsOn="{Binding ShowLineMarker,Mode=TwoWay}" Header = "キャレットラインを表示する" HorizontalAlignment="Stretch"/>\r
         <ToggleSwitch Margin="-6, 0, 0, 0" IsOn="{Binding HilightXML,Mode=TwoWay}" Header = "XMLドキュメントのハイライトを行う" HorizontalAlignment="Stretch"/>\r
+        <ToggleSwitch Margin="-6, 0, 0, 0" IsOn="{Binding IsVisible,Mode=TwoWay}" Header = "Visiblity is visible" HorizontalAlignment="Stretch"/>\r
         <ComboBox ItemsSource="{Binding LineBreakMethodList}" SelectedItem="{Binding CurrentLineBreakMethod,Mode=TwoWay}">\r
             <ComboBox.ItemTemplate>\r
                 <DataTemplate>\r
index 17084f7..57370cb 100644 (file)
@@ -431,7 +431,7 @@ namespace FooEditEngine.WPF
         \r
         void Refresh(Rectangle updateRect)\r
         {\r
-            if (this.disposed)\r
+            if (this.disposed || this.Visibility == Visibility.Collapsed)\r
                 return;\r
 \r
             this.timer.Stop();\r