コード例 #1
0
        protected NavigationTreeViewModel(BluePrintsEntitiesModuleDescription[] modules, string selectedTitle, BluePrintsEntitiesViewModel owner)
        {
            Owner       = owner;
            Modules     = modules;
            DefaultItem = Modules.FirstOrDefault(x => x.ModuleTitle == selectedTitle);
            if (DefaultItem != null)
            {
                DefaultItem.IsSelected = true;
                SelectedItem           = DefaultItem;
            }

            if (selectedTitle.Length > 7)
            {
                StaticCategoryName = selectedTitle.Substring(0, 7);
            }
            else
            {
                StaticCategoryName = "[" + selectedTitle + "]";
            }

            defaultSelectionTimer          = new DispatcherTimer();
            defaultSelectionTimer.Interval = new TimeSpan(0, 0, 0, 0, 1);
            defaultSelectionTimer.Tick    += defaultSelectionTimer_Tick;
        }
コード例 #2
0
 public static NavigationTreeViewModel Create(BluePrintsEntitiesModuleDescription[] modules, string selectedTitle, BluePrintsEntitiesViewModel owner)
 {
     return(ViewModelSource.Create(() => new NavigationTreeViewModel(modules, selectedTitle, owner)));
 }