/* * <StackPanel x:Name="Button_Folder_Content_Panel" Grid.Column="1" Visibility="Collapsed"> * <Button Content="New" Command="ApplicationCommands.New" Background="#fadadada" Foreground="Black"/> * <Button Content="Open File" Command="ApplicationCommands.Open" Background="#fadadada" Foreground="Black"/> * <Button Content="Save File" Command="ApplicationCommands.Save" Background="#fadadada" Foreground="Black"/> * <Button Content="Save File As" Command="ApplicationCommands.SaveAs" Background="#fadadada" Foreground="Black"/> * </StackPanel> * * <ToggleButton x:Name="Button_Settings" Style="{StaticResource OnOffToggleImageStyle}" Content="{StaticResource SettImg}" Grid.Column="0" Grid.Row="2" VerticalAlignment="Top" IsChecked="False" Click="Button_Settings_Click"/> * public static StackPanel MakePanelButtonsSettings() { * Button theme = new Button(); * theme.Content = "Theme"; * theme.Background = new SolidColorBrush(Colors.Transparent); * theme.Foreground = new SolidColorBrush(Colors.Black); * * Button scale = new Button(); * scale.Content = "Scale"; * scale.Background = new SolidColorBrush(Colors.Transparent); * scale.Foreground = new SolidColorBrush(Colors.Black); * * Button sprawka = new Button(); * sprawka.Content = "About"; * sprawka.Background = new SolidColorBrush(Colors.Transparent); * sprawka.Foreground = new SolidColorBrush(Colors.Black); * * StackPanel panel = new StackPanel(); * panel.Visibility = Visibility.Collapsed; * Grid.SetColumn(panel, 1); * panel.Children.Add(theme); * panel.Children.Add(scale); * panel.Children.Add(sprawka); * * return panel; * } */ #endregion // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region doc select change handler contain bindign to handlers when select doc or close doc binding Proccessor selected doc to documentsVM selectedDoc private void Changes_Flow_Docs(object sender, NotifyCollectionChangedEventArgs e) { switch (e.Action) { case NotifyCollectionChangedAction.Add: ButtonForFlowDoc but = new ButtonForFlowDoc((FlowDocumentBox)e.NewItems[0]); ButtonsFlowDocs.Add(but); but.ButtonFileSelectClick += Button_Doc_SelectChange_EventHandler; //Binding to select but.ButtonFileCloseClick += Button_Doc_Close_EventHandler; //Binding to close break; case NotifyCollectionChangedAction.Remove: ButtonsFlowDocs.Remove((e.OldItems[0] as FlowDocumentBox).ButtonToManipulateDoc); break; } }
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region work with docs list to select doc ,close doc etc. if doc close make select first in collection !!НЕЛЬЗЯ ВО VIEWMODEL ПОТОМУ ЧТО ТОГДА ЭТО БУДЕТ ПРИВЯЗКА К ОПРЕДЕЛЁННОМУ VIEW!! private void Button_Doc_SelectChange_EventHandler(object sender) { ButtonForFlowDoc selection = (ButtonForFlowDoc)sender; DocumentsViewModel.SelectedDocumentBox = selection.FlowDocBox; }