Browse Source

Now layer name is updating in model

Frytek 5 years ago
parent
commit
06f02fc142
2 changed files with 13 additions and 2 deletions
  1. 12 1
      PixiEditor/Models/Layers/Layer.cs
  2. 1 1
      PixiEditor/Views/MainWindow.xaml

+ 12 - 1
PixiEditor/Models/Layers/Layer.cs

@@ -7,7 +7,18 @@ namespace PixiEditor.Models.Layers
     public class Layer : BasicLayer
     public class Layer : BasicLayer
     {
     {
         private WriteableBitmap _layerBitmap;
         private WriteableBitmap _layerBitmap;
-        public string Name { get; set; }
+        private string _name;
+
+        public string Name
+        {
+            get { return _name; }
+            set 
+            { 
+                _name = value;
+                RaisePropertyChanged("Name");
+            }
+        }
+
 
 
         private bool _isActive = false;
         private bool _isActive = false;
         public bool IsActive
         public bool IsActive

+ 1 - 1
PixiEditor/Views/MainWindow.xaml

@@ -215,7 +215,7 @@
                             Path=(ItemsControl.AlternationIndex)}"/>
                             Path=(ItemsControl.AlternationIndex)}"/>
                                                                 </ContextMenu>
                                                                 </ContextMenu>
                                                             </Button.ContextMenu>
                                                             </Button.ContextMenu>
-                                                            <vws:EditableTextBlock Text="{Binding Name}"/>
+                                                            <vws:EditableTextBlock Text="{Binding Name, Mode=TwoWay}"/>
                                                         </Button>
                                                         </Button>
                                                     </DockPanel>
                                                     </DockPanel>
                                                 </Border>
                                                 </Border>