...
private bool check;
public bool IsExpanded
{
get { return _isExpanded; }
set
{
_isExpanded = value;
if (!check)
{
check= true;
Children = model.SetObject(ObjDoc.Objects);
OnPropertyChanged();
}
}
}
...
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
</Style>
</TreeView.ItemContainerStyle>
class BootStrapper
{
Views.SplashScreen splash = new Views.SplashScreen();
MainWindow mainWindow = new MainWindow();
public void Start()
{
var timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromSeconds(10);
timer.Tick += (s, e) =>
{
splash.Close();
mainWindow.Show();
timer.Stop();
};
timer.Start();
splash.Show();
}
}
protected override void OnStartup(StartupEventArgs e)
{
BootStrapper bootStrapper = new BootStrapper();
bootStrapper.Start();
base.OnStartup(e);
}