コード例 #1
0
ファイル: managementlist.cs プロジェクト: v-pham/PowerShell
        private void ViewManager_ItemSelected(object sender, DataRoutedEventArgs <object> e)
        {
            if (e.Data == null)
            {
                throw new ArgumentException("e.Data is null", "e");
            }

            StateDescriptor <ManagementList> sd = (StateDescriptor <ManagementList>)e.Data;

            sd.RestoreState(this);

            this.CurrentView = sd;
        }
コード例 #2
0
ファイル: managementlist.cs プロジェクト: v-pham/PowerShell
        private void ViewManager_ItemDeleted(object sender, DataRoutedEventArgs <object> e)
        {
            if (e.Data == null)
            {
                throw new ArgumentException("e.Data is null", "e");
            }

            StateDescriptor <ManagementList> sd = (StateDescriptor <ManagementList>)e.Data;

            this.Views.Remove(sd);

            this.RaiseEvent(new RoutedEventArgs(ViewsChangedEvent));

            if (object.ReferenceEquals(sd, this.CurrentView))
            {
                this.CurrentView = null;
            }
        }