///// <summary> ///// starts from 1. ///// </summary> //private int FromZoomLevelIndex //{ // get { return styleBuilderViewModel.FromZoomLevelIndex; } // set { styleBuilderViewModel.FromZoomLevelIndex = value; } //} ///// <summary> ///// starts from 1. ///// </summary> //private int ToZoomLevelIndex //{ // get { return styleBuilderViewModel.ToZoomLevelIndex; } // set { styleBuilderViewModel.ToZoomLevelIndex = value; } //} /// <summary> /// Handles the Loaded event of the StyleBuilderWindow control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param> private void StyleBuilderWindow_Loaded(object sender, RoutedEventArgs e) { multiStyleBuilderViewModel = new MultiStyleBuilderViewModel(); foreach (var item in styleBuilderArguments) { CompositeStyle tempStyle = item.StyleToEdit; if (tempStyle == null) { tempStyle = new CompositeStyle(); } StyleBuilderViewModel currentViewModel = new StyleBuilderViewModel(tempStyle, item); currentViewModel.FromZoomLevelIndex = item.FromZoomLevelIndex; currentViewModel.ToZoomLevelIndex = item.ToZoomLevelIndex; multiStyleBuilderViewModel.StyleBuilderViewModels.Add(currentViewModel); } multiStyleBuilderViewModel.SelectedStyleBuilderViewModel = multiStyleBuilderViewModel.StyleBuilderViewModels.FirstOrDefault(); DataContext = multiStyleBuilderViewModel; if (multiStyleBuilderViewModel.SelectedStyleBuilderViewModel != null && multiStyleBuilderViewModel.SelectedStyleBuilderViewModel.RootStyleItem != null && multiStyleBuilderViewModel.SelectedStyleBuilderViewModel.RootStyleItem.StyleItemViewModels.Count == 0) { if (Validate()) { multiStyleBuilderViewModel.SelectedStyleBuilderViewModel.IsRootNodeSelected = true; //RootNodePanel.Background = new SolidColorBrush(Color.FromRgb(173, 216, 230)); multiStyleBuilderViewModel.SelectedStyleBuilderViewModel.RootNodeBackground = defaultRootNodeBackground; } } }
/// <summary> /// Handles the Loaded event of the StyleBuilderWindow control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param> private void StyleBuilderWindow_Loaded(object sender, RoutedEventArgs e) { var styleToEdit = styleBuilderArguments.StyleToEdit; if (styleToEdit == null) { styleToEdit = new CompositeStyle(); } styleBuilderResult = new StyleBuilderResult(); styleBuilderViewModel = new StyleBuilderViewModel(styleToEdit, styleBuilderArguments); DataContext = styleBuilderViewModel; FromZoomLevelIndex = styleBuilderArguments.FromZoomLevelIndex; ToZoomLevelIndex = styleBuilderArguments.ToZoomLevelIndex; if (styleBuilderViewModel.RootStyleItem != null && styleBuilderViewModel.RootStyleItem.StyleItemViewModels.Count == 0) { if (Validate()) { styleBuilderViewModel.IsRootNodeSelected = true; RootNodePanel.Background = new SolidColorBrush(Color.FromRgb(173, 216, 230)); } } }