Add IsExpanded property to ElementViewModel.
This commit is contained in:
parent
2bb0452a87
commit
a9d0e8ee7e
@ -41,6 +41,16 @@ namespace zaaReloaded2.ViewModels
|
||||
|
||||
public abstract string ToolTip { get; }
|
||||
|
||||
public bool IsExpanded
|
||||
{
|
||||
get { return _isExpanded; }
|
||||
set
|
||||
{
|
||||
_isExpanded = value;
|
||||
OnPropertyChanged("IsExpanded");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
@ -77,7 +87,7 @@ namespace zaaReloaded2.ViewModels
|
||||
|
||||
#region Fields
|
||||
|
||||
string _displayString;
|
||||
bool _isExpanded;
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
@ -503,6 +503,7 @@ namespace zaaReloaded2.ViewModels
|
||||
ControlElementViewModel controlElementAbove =
|
||||
Elements[index - 1] as ControlElementViewModel;
|
||||
Elements.RemoveAt(index);
|
||||
controlElementAbove.IsExpanded = true;
|
||||
controlElementAbove.AddChildElement(
|
||||
lastSelectedElement as FormatElementViewModel);
|
||||
FormatElementBase model = lastSelectedElement.RevealModelObject() as FormatElementBase;
|
||||
@ -599,6 +600,7 @@ namespace zaaReloaded2.ViewModels
|
||||
ControlElementViewModel controlElementBelow =
|
||||
Elements[index + 1] as ControlElementViewModel;
|
||||
Elements.RemoveAt(index);
|
||||
controlElementBelow.IsExpanded = true;
|
||||
controlElementBelow.Elements.Insert(
|
||||
0,
|
||||
lastSelectedElement as FormatElementViewModel);
|
||||
|
@ -95,7 +95,7 @@
|
||||
<TreeView ItemsSource="{Binding Elements}">
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<!--<Setter Property="IsExpanded" Value="True" />-->
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
<Setter Property="ToolTip" Value="{Binding ToolTip}" />
|
||||
</Style>
|
||||
|
Loading…
Reference in New Issue
Block a user