4 Commits 8549780ff5 ... e44f461d46

Author SHA1 Message Date
  JET-GZX e44f461d46 modify all read Permission 1 month ago
  JET-GZX 660f63e45a Header,config,role 的read权权限功能 1 month ago
  JET-GZX 333af02a56 Merge branch 'master' of http://git.jetplasma-oa.com/JetPlasma/Virgo_Mask 1 month ago
  JET-GZX 6b88580e58 correct role 1 month ago

+ 1 - 1
VirgoUI/MainView.xaml

@@ -371,7 +371,7 @@
                                 <Border BorderBrush="{DynamicResource TopFrame_TableBD_Shadow}" BorderThickness="0,0,1,1" CornerRadius="0,0,5,0" Padding="5,2"/>
                             </Border>
                         </Grid>
-                        <StackPanel Grid.Column="7" Grid.RowSpan="3" VerticalAlignment="Center">
+                        <StackPanel Grid.Column="7" Grid.RowSpan="3" VerticalAlignment="Bottom" Margin="0,0,0,6"  IsEnabled="{Binding PageEnabled}">
                             <Grid Margin="5,0,0,0">
                                 <Grid.ColumnDefinitions>
                                     <ColumnDefinition />

+ 31 - 3
VirgoUI/MainViewModel.cs

@@ -38,6 +38,7 @@ using VirgoCommon;
 using VirgoUI.Client.Models.History.Statistics;
 using VirgoUI.Client.Models.Operate.WaferAssociation;
 using VirgoUI.Client.Models.PMs;
+using VirgoUI.Client.Models.Sys;
 using Cali = Caliburn.Micro.Core;
 
 namespace VirgoUI.Client
@@ -820,11 +821,9 @@ namespace VirgoUI.Client
                     //ClientApp.Instance.UserContext.Token = token;
                     ClientApp.Instance.UserContext.LastAccessTime = DateTime.Now;
                     ClientApp.Instance.UserContext.IsLogin = true;
-
                     //Load menu by role
                     //filer menu if necessary...
-                    ClientApp.Instance.MenuManager.LoadMenu(RoleAccountProvider.Instance.GetMenusByRole(role.RoleID, ClientApp.Instance.MenuLoader.MenuList));
-
+                    ClientApp.Instance.MenuManager.LoadMenu(RoleAccountProvider.Instance.GetMenusByRole(role.RoleID, ClientApp.Instance.MenuLoader.MenuList));                 
                     IsAutoLogout = role.IsAutoLogout;
                     LogoutTime = role.LogoutTime;
                     InitMenu(); //bind menu to main view
@@ -975,6 +974,28 @@ namespace VirgoUI.Client
 
         }
 
+        private Dictionary<string, int> _permissionMap;
+
+        private void ParsePermissions(string permissionString)
+        {
+            _permissionMap = permissionString
+                .Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)
+                .Select(part => part.Split(','))
+                .Where(arr => arr.Length == 2)
+                .ToDictionary(
+                    arr => arr[0].Trim(),
+                    arr => int.TryParse(arr[1].Trim(), out var val) ? val : 0);
+        }
+        public bool PageEnabled
+        {
+            get
+            {
+                if (_permissionMap == null || !_permissionMap.TryGetValue("Header", out var level))
+                    return true;          
+                return level == 3;         
+            }
+        }
+        
         protected override bool OnTimer()
         {
             try
@@ -983,9 +1004,16 @@ namespace VirgoUI.Client
                 List<Role> roles = RoleAccountProvider.Instance.GetRoles();
                 if (!string.IsNullOrEmpty(ClientApp.Instance.UserContext.RoleName))
                 {
+                    //var _Permission = roles.Find(AccountManager.GetSingleRolePermission(RoleName));
+                    //PageEnabled = true;
+                    //var permissions = AccountManager.GetSingleRolePermission(ClientApp.Instance.UserContext.RoleName);
+                    //var permission = ClientApp.Instance.UserContext.Role.MenuPermission;
+                    ParsePermissions(ClientApp.Instance.UserContext.Role.MenuPermission);
+
                     Role role = roles.Find(x => x.RoleName == ClientApp.Instance.UserContext.RoleName);
                     LogoutTime = role.LogoutTime;
                     IsAutoLogout = role.IsAutoLogout;
+                    //NotifyOfPropertyChange(() => PageEnabled);
                     int intervaltime = GetLastInputTime();
                     //if (System.DateTime.Now >= ClientApp.Instance.UserContext.LoginTime.AddMinutes(LogoutTime) && IsLogin && IsAutoLogout)
                     if (intervaltime >= LogoutTime * 60 && IsLogin && IsAutoLogout)

+ 1 - 0
VirgoUI/Models/Operate/Overview/OverView.xaml

@@ -228,6 +228,7 @@
 
                     </Canvas>
                 </Viewbox>
+                <Image HorizontalAlignment="Left" Height="100" Margin="754,643,0,0" VerticalAlignment="Top" Width="100"/>
             </Grid>
 
             <TabControl Grid.Column="1" Margin="0,5,0,85">

+ 20 - 16
VirgoUI/Models/PMs/RecipeEditorView.xaml

@@ -29,40 +29,40 @@
                 <StackPanel VerticalAlignment="Bottom" IsEnabled="{Binding PageEnabled}">
                     <StackPanel Orientation="Horizontal">
                         <Button Content="New" Width="85" Height="30" Style="{StaticResource MiddleButton}" Click="ButtonNew">
- 
+
                         </Button>
                         <Button Content="Rename" Margin="10,0,0,0" Width="85" Height="30" Style="{StaticResource MiddleButton}" Click="ButtonRename">
- 
+
                         </Button>
                         <Button Content="Delete" Margin="10,0,0,0" Width="85" Height="30" Style="{StaticResource MiddleButton}" Click="ButtonDelete">
- 
+
                         </Button>
                     </StackPanel>
 
                     <TextBlock Text="Recipe List" Margin="5" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
                 </StackPanel>
-                
+
             </Border>
-        <Border Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
+            <Border Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
                 <TreeView Name="treeViewRcpList" Margin="0,6" SelectedItemChanged="treeViewRcpList_SelectedItemChanged" MouseRightButtonDown="treeViewRcpList_MouseRightButtonDown" MouseMove="TreeViewRcpList_MouseMove"
                       FontSize="14" BorderThickness="1" BorderBrush="Black" Canvas.Top="140" Canvas.Left="4" Opacity="1" Background="LightSteelBlue" PreviewMouseDown="TreeViewRcpList_MouseDown"  AllowDrop="True" 
                       DragEnter="TreeViewRcpList_DragEnter"  DragOver="TreeViewRcpList_DragEnter" DragLeave="TreeViewRcpList_DragEnter" Drop="TreeViewRcpList_Drop">
-                <TreeView.ItemContainerStyle>
-                    <Style TargetType="{x:Type TreeViewItem}">
-                        <EventSetter Event="TreeViewItem.PreviewMouseRightButtonDown" Handler="TreeViewItem_MouseRightButtonDown" />
-                    </Style>
-                </TreeView.ItemContainerStyle>
-            </TreeView>
+                    <TreeView.ItemContainerStyle>
+                        <Style TargetType="{x:Type TreeViewItem}">
+                            <EventSetter Event="TreeViewItem.PreviewMouseRightButtonDown" Handler="TreeViewItem_MouseRightButtonDown" />
+                        </Style>
+                    </TreeView.ItemContainerStyle>
+                </TreeView>
             </Border>
         </Grid>
- 
+
         <GridSplitter Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="Transparent" />
-        <Grid x:Name="gridDisplay" Grid.Column="2">
+        <Grid x:Name="gridDisplay" Grid.Column="2" IsEnabled="{Binding PageEnabled}">
             <Grid.RowDefinitions>
                 <RowDefinition Height="40" />
                 <RowDefinition Height="706*" />
             </Grid.RowDefinitions>
-            <StackPanel Grid.Row="0" Orientation="Horizontal" IsEnabled="{Binding PageEnabled}">
+            <StackPanel Grid.Row="0" Orientation="Horizontal">
                 <Label  Content="{DynamicResource GlobalLableCurrentRecipe}" FontSize="15" Height="31" HorizontalAlignment="Left" HorizontalContentAlignment="Center" Margin="5,3,0,0" Name="label2" VerticalAlignment="Top"  FontWeight="Normal" />
 
                 <Label Height="31" Margin="22,3,0,0" Name="labelSelectedRecipe" VerticalAlignment="Top"  Content="{Binding Path=CurrentRecipeName}" FontSize="15" HorizontalContentAlignment="Left" HorizontalAlignment="Left"   FontWeight="Normal" />
@@ -73,12 +73,16 @@
                             <MenuItem Name="SaveToSingle" Click="SaveToSingle_Click"/>
                             <MenuItem Name="SaveToDouble" Click="SaveToDouble_Click" />
                         </ContextMenu>
-                        </Button.ContextMenu>
+                    </Button.ContextMenu>
                 </Button>
             </StackPanel>
 
             <Grid Grid.Row="1">
-                <core:RecipeEditorControl x:Name="tableRecipeGrid" FontSize="12" BorderThickness="1" BorderBrush="Black" Margin="0,0,0,6" />
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="13*"/>
+                    <ColumnDefinition Width="1601*"/>
+                </Grid.ColumnDefinitions>
+                <core:RecipeEditorControl x:Name="tableRecipeGrid" FontSize="12" BorderThickness="1" BorderBrush="Black" Margin="0,0,0,6" Grid.ColumnSpan="2" />
             </Grid>
         </Grid>
     </Grid>

+ 2 - 2
VirgoUI/Models/Recipe/Sequence/SequenceView.xaml

@@ -323,7 +323,7 @@
                 </TreeView>
             </Border>
         </Grid>
-        <Grid Grid.Column="1">
+        <Grid Grid.Column="1" IsEnabled="{Binding PageEnabled}">
             <Grid.RowDefinitions>
                 <RowDefinition Height="Auto"/>
                 <RowDefinition />
@@ -380,7 +380,7 @@
                     <RowDefinition />
                 </Grid.RowDefinitions>
                 <Grid>
-                    <StackPanel Orientation="Horizontal" IsEnabled="{Binding PageEnabled}">
+                    <StackPanel Orientation="Horizontal">
                         <Button Content="Append" Width="90" Height="30" IsEnabled="{Binding EnableStep}">
                             <i:Interaction.Triggers>
                                 <i:EventTrigger EventName="Click">

+ 93 - 5
VirgoUI/Models/Utility/Account/AccountView.xaml

@@ -4,7 +4,7 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
-             xmlns:ControlLib="http://OpenSEMI.Ctrlib.com/presentation"      IsEnabled="{Binding PageEnabled}"
+             xmlns:ControlLib="http://OpenSEMI.Ctrlib.com/presentation"     
              xmlns:cal="http://www.caliburn.org" >
     <UserControl.Resources>
         <Style x:Key="ViewEnabledBtn" TargetType="{x:Type Button}" BasedOn="{StaticResource ResourceKey={x:Type Button}}">
@@ -32,7 +32,7 @@
             </Style.Triggers>
         </Style>
     </UserControl.Resources>
-    
+
     <Grid x:Name="MainTable" MinHeight="450" HorizontalAlignment="Left" MinWidth="1200">
         <Grid x:Name="MainField">
             <Grid.ColumnDefinitions>
@@ -53,9 +53,13 @@
                     <Style TargetType="{x:Type ListView}" BasedOn="{StaticResource ResourceKey={x:Type ListView}}">
                         <Setter Property="ListView.IsEnabled" Value="False"/>
                         <Style.Triggers>
-                            <DataTrigger Binding="{Binding ControlMode}" Value="VIEW">
+                            <MultiDataTrigger>
+                                <MultiDataTrigger.Conditions>
+                                    <Condition Binding="{Binding Permission}" Value="3" />
+                                    <Condition Binding="{Binding ControlMode}" Value="VIEW"/>
+                                </MultiDataTrigger.Conditions>
                                 <Setter Property="ListView.IsEnabled" Value="True"/>
-                            </DataTrigger>
+                            </MultiDataTrigger>
                         </Style.Triggers>
                     </Style>
                 </ListView.Style>
@@ -113,6 +117,20 @@
                         </Border>
                         <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Column="1" Padding="5,1">
                             <PasswordBox Name="pwNewPassword" HorizontalAlignment="Left" MaxLength="50" Width="200">
+                                <PasswordBox.Style>
+                                    <Style TargetType="{x:Type PasswordBox}" BasedOn="{StaticResource {x:Type PasswordBox}}">
+                                        <Setter Property="IsEnabled" Value="False"/>
+                                        <Style.Triggers>
+                                            <MultiDataTrigger>
+                                                <MultiDataTrigger.Conditions>
+                                                    <Condition Binding="{Binding Permission}" Value="3"/>
+                                                    <Condition Binding="{Binding ControlMode}" Value="VIEW"/>
+                                                </MultiDataTrigger.Conditions>
+                                                <Setter Property="IsEnabled" Value="True"/>
+                                            </MultiDataTrigger>
+                                        </Style.Triggers>
+                                    </Style>
+                                </PasswordBox.Style>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="PasswordChanged">
                                         <cal:ActionMessage MethodName="OnAccountChanged">
@@ -132,6 +150,20 @@
                         </Border>
                         <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Column="1" Padding="5,1">
                             <PasswordBox Name="pwConfirmPassword" HorizontalAlignment="Left" MaxLength="50" Width="200">
+                                <PasswordBox.Style>
+                                    <Style TargetType="{x:Type PasswordBox}" BasedOn="{StaticResource {x:Type PasswordBox}}">
+                                        <Setter Property="IsEnabled" Value="False"/>
+                                        <Style.Triggers>
+                                            <MultiDataTrigger>
+                                                <MultiDataTrigger.Conditions>
+                                                    <Condition Binding="{Binding Permission}" Value="3"/>
+                                                    <Condition Binding="{Binding ControlMode}" Value="VIEW"/>
+                                                </MultiDataTrigger.Conditions>
+                                                <Setter Property="IsEnabled" Value="True"/>
+                                            </MultiDataTrigger>
+                                        </Style.Triggers>
+                                    </Style>
+                                </PasswordBox.Style>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="PasswordChanged">
                                         <cal:ActionMessage MethodName="OnAccountChanged">
@@ -152,6 +184,20 @@
                         <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Column="1" Padding="5,1">
                             <ControlLib:TextBoxEx Text="{Binding TreeSelectedAccount.DisplayFirstName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ValidationTemplate}" HorizontalContentAlignment="Left" TextSaved="{Binding Mode=TwoWay, Path=TreeSelectedAccount.FirstNameTextSaved }"  Name="TbFirstName"  
                         HorizontalAlignment="Left" VerticalAlignment="Top" MaxLength="50" Width="200">
+                                <ControlLib:TextBoxEx.Style>
+                                    <Style TargetType="{x:Type ControlLib:TextBoxEx}" BasedOn="{StaticResource {x:Type ControlLib:TextBoxEx}}">
+                                        <Setter Property="IsEnabled" Value="False"/>
+                                        <Style.Triggers>
+                                            <MultiDataTrigger>
+                                                <MultiDataTrigger.Conditions>
+                                                    <Condition Binding="{Binding Permission}" Value="3"/>
+                                                    <Condition Binding="{Binding ControlMode}" Value="VIEW"/>
+                                                </MultiDataTrigger.Conditions>
+                                                <Setter Property="IsEnabled" Value="True"/>
+                                            </MultiDataTrigger>
+                                        </Style.Triggers>
+                                    </Style>
+                                </ControlLib:TextBoxEx.Style>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="TextChanged">
                                         <cal:ActionMessage MethodName="OnAccountChanged">
@@ -172,6 +218,20 @@
                         <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Column="1" Padding="5,1">
                             <ControlLib:TextBoxEx Text="{Binding TreeSelectedAccount.DisplayLastName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ValidationTemplate}" HorizontalContentAlignment="Left"   TextSaved="{Binding Mode=TwoWay, Path=TreeSelectedAccount.LastNameTextSaved }"  Name="TbLastName"  
                         HorizontalAlignment="Left" VerticalAlignment="Top" MaxLength="50" Width="200">
+                                <ControlLib:TextBoxEx.Style>
+                                    <Style TargetType="{x:Type ControlLib:TextBoxEx}" BasedOn="{StaticResource {x:Type ControlLib:TextBoxEx}}">
+                                        <Setter Property="IsEnabled" Value="False"/>
+                                        <Style.Triggers>
+                                            <MultiDataTrigger>
+                                                <MultiDataTrigger.Conditions>
+                                                    <Condition Binding="{Binding Permission}" Value="3"/>
+                                                    <Condition Binding="{Binding ControlMode}" Value="VIEW"/>
+                                                </MultiDataTrigger.Conditions>
+                                                <Setter Property="IsEnabled" Value="True"/>
+                                            </MultiDataTrigger>
+                                        </Style.Triggers>
+                                    </Style>
+                                </ControlLib:TextBoxEx.Style>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="TextChanged">
                                         <cal:ActionMessage MethodName="OnAccountChanged">
@@ -192,6 +252,20 @@
                         <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Column="1" Padding="5,1">
                             <ControlLib:TextBoxEx Text="{Binding TreeSelectedAccount.DisplayEmail,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ValidationTemplate}" HorizontalContentAlignment="Left"   TextSaved="{Binding Mode=TwoWay, Path=TreeSelectedAccount.EmailTextSaved }"  Name="TbEmail"  
                         HorizontalAlignment="Left" VerticalAlignment="Top" MaxLength="50" Width="200">
+                                <ControlLib:TextBoxEx.Style>
+                                    <Style TargetType="{x:Type ControlLib:TextBoxEx}" BasedOn="{StaticResource {x:Type ControlLib:TextBoxEx}}">
+                                        <Setter Property="IsEnabled" Value="False"/>
+                                        <Style.Triggers>
+                                            <MultiDataTrigger>
+                                                <MultiDataTrigger.Conditions>
+                                                    <Condition Binding="{Binding Permission}" Value="3"/>
+                                                    <Condition Binding="{Binding ControlMode}" Value="VIEW"/>
+                                                </MultiDataTrigger.Conditions>
+                                                <Setter Property="IsEnabled" Value="True"/>
+                                            </MultiDataTrigger>
+                                        </Style.Triggers>
+                                    </Style>
+                                </ControlLib:TextBoxEx.Style>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="TextChanged">
                                         <cal:ActionMessage MethodName="OnAccountChanged">
@@ -205,13 +279,27 @@
                 <TabControl Grid.Row="2" Margin="0,10,0,0">
                     <TabItem Header="Role Status">
                         <ListView Name="RolesStatusList" AlternationCount="2" ItemsSource="{Binding Path=TreeSelectedAccount.RoleColleciton}" VerticalAlignment="Top">
+                            <ListView.Style>
+                                <Style TargetType="{x:Type ListView}" BasedOn="{StaticResource {x:Type ListView}}">
+                                    <Setter Property="IsEnabled" Value="False"/>
+                                    <Style.Triggers>
+                                        <MultiDataTrigger>
+                                            <MultiDataTrigger.Conditions>
+                                                <Condition Binding="{Binding Permission}" Value="3"/>
+                                                <Condition Binding="{Binding ControlMode}" Value="VIEW"/>
+                                            </MultiDataTrigger.Conditions>
+                                            <Setter Property="IsEnabled" Value="True"/>
+                                        </MultiDataTrigger>
+                                    </Style.Triggers>
+                                </Style>
+                            </ListView.Style>
                             <ListView.View>
                                 <GridView>
                                     <GridViewColumn Width="150" Header="Role" DisplayMemberBinding="{Binding RoleName}" />
                                     <GridViewColumn Width="100" Header="Status">
                                         <GridViewColumn.CellTemplate>
                                             <DataTemplate >
-                                                <CheckBox IsChecked="{Binding DisplayRoleStatus}"  >
+                                                <CheckBox IsChecked="{Binding DisplayRoleStatus}">
                                                     <i:Interaction.Triggers>
                                                         <i:EventTrigger EventName="Click">
                                                             <cal:ActionMessage MethodName="OnAccountChanged">

+ 5 - 0
VirgoUI/Models/Utility/Account/AccountView.xaml.cs

@@ -24,5 +24,10 @@ namespace VirgoUI.Client.Models.Utility.AccountPage
         {
             InitializeComponent();
         }
+
+        private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
     }
 }

+ 1 - 1
VirgoUI/Models/Utility/Account/AccountViewModel.cs

@@ -35,7 +35,7 @@ namespace VirgoUI.Client.Models.Utility.AccountPage
         {
             get { return _AccountsList; }
         }
-
+        
         public AccountManager AccountManager
         {
             get { return AccountManager.Instance; }

+ 2 - 2
VirgoUI/Models/Utility/Role/RoleView.xaml

@@ -181,7 +181,6 @@
                                   ScrollViewer.VerticalScrollBarVisibility="Auto"
                                   ScrollViewer.CanContentScroll="True"
                                   ItemsSource="{Binding Path=TreeSelectedRole.MenuCollection}">
-
                             <ListView.View>
                                 <GridView>
                                     <GridViewColumn Width="200" Header="Menu Name" DisplayMemberBinding="{Binding Name}"/>
@@ -192,7 +191,8 @@
                                                 DisplayMemberPath="StringPermission"
                                                 SelectedIndex="{Binding DisplayIndexPermission}"                                                                          
                                                 ItemsSource="{Binding DataContext.PermissionDictionary,
-                                                RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
+                                                RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
+                                                IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path= DataContext.PageEnabled}">
                                                     <i:Interaction.Triggers>
                                                         <i:EventTrigger EventName="SelectionChanged">
                                                             <cal:ActionMessage MethodName="OnRoleChanged">

+ 3 - 3
VirgoUI/Models/Utility/SystemConfig/SystemConfigView.xaml

@@ -121,12 +121,12 @@
 
         </GridSplitter>
 
-        <Grid Grid.Column="1" Margin="10,0,0,0">
+        <Grid Grid.Column="1" Margin="10,0,0,0" IsEnabled="{Binding PageEnabled}">
             <Grid.RowDefinitions>
                 <RowDefinition Height="Auto"/>
                 <RowDefinition />
             </Grid.RowDefinitions>
-            <StackPanel Orientation="Horizontal" IsEnabled="{Binding PageEnabled}">
+            <StackPanel Orientation="Horizontal">
                 <Border  BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Margin="0,3,0,0" Background="{DynamicResource Table_BG_Content}" Width="220">
                     <TextBlock  TextAlignment="Left" VerticalAlignment="Center" Margin="5,0,0,0"  TextWrapping="Wrap" Text="{Binding CurrentNodeName}"></TextBlock>
                 </Border>
@@ -236,7 +236,7 @@
                     <DataGridTemplateColumn MinWidth="80">
                         <DataGridTemplateColumn.CellTemplate>
                             <DataTemplate>
-                                <Button Content="Set" Width="60" Height="20" FontSize="12">
+                                <Button Content="Set" Width="60" Height="20" FontSize="12" IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path= DataContext.PageEnabled}">
                                     <i:Interaction.Triggers>
                                         <i:EventTrigger EventName="Click">
                                             <cal:ActionMessage MethodName="SetValue">