コード例 #1
0
 private void NoDisplayDataMessage()
 {
     MainBorder.IsEnabled = false;
     DataNotSpecifiedNotification.Show();
 }
コード例 #2
0
        private void DrawAccounts([NotNull] XContainer element)
        {
            Debug.ArgumentNotNull(element, nameof(element));

            var accounts = element.Descendants(SecurityStruct.Node.Account);

            if (!accounts.Any())
            {
                MainBorder.IsEnabled = false;
                DataNotSpecifiedNotification.Show();
                return;
            }

            var listOfAccounts = new Grid();

            listOfAccounts.ColumnDefinitions.Add(new ColumnDefinition
            {
                Width = GridLength.Auto
            });
            listOfAccounts.ColumnDefinitions.Add(new ColumnDefinition());

            listOfAccounts.RowDefinitions.Add(new RowDefinition());

            var txtAccounts = new TextBlock
            {
                Text   = Rocks.Resources.SecurityField_DrawAccounts_Accounts,
                Margin = new Thickness(0.0, 0.0, 6.0, 0.0),
                Style  = Resources[@"stlHeader"] as Style
            };

            Grid.SetRow(txtAccounts, 0);
            Grid.SetColumn(txtAccounts, 0);
            listOfAccounts.Children.Add(txtAccounts);

            var txtPermissions = new TextBlock
            {
                Text  = Rocks.Resources.SecurityField_DrawAccounts_Permissions,
                Style = Resources[@"stlHeader"] as Style
            };

            Grid.SetRow(txtPermissions, 0);
            Grid.SetColumn(txtPermissions, 1);
            listOfAccounts.Children.Add(txtPermissions);

            var row = 1;

            foreach (var account in accounts)
            {
                listOfAccounts.RowDefinitions.Add(new RowDefinition());

                var accountHeader = new StackPanel
                {
                    Orientation = Orientation.Horizontal
                };
                DrawAccountHeader(account, accountHeader);
                Grid.SetRow(accountHeader, row);
                Grid.SetColumn(accountHeader, 0);
                listOfAccounts.Children.Add(accountHeader);

                var accountPermissions = new StackPanel
                {
                    Margin = new Thickness(0.0, 0.0, 0.0, 12.0)
                };
                DrawAccountPermissions(account, accountPermissions);
                Grid.SetRow(accountPermissions, row);
                Grid.SetColumn(accountPermissions, 1);
                listOfAccounts.Children.Add(accountPermissions);

                row++;
            }

            stkMain.Children.Add(listOfAccounts);
        }