Esempio n. 1
0
        private void EventsView_SetColorClick(object sender, Event e)
        {
            foreach (EventColor eventColor in viewModel.Settings.EventColors.Collection)
            {
                if (!Utils.IsEvent(eventColor, e.Group, e.Name))
                {
                    continue;
                }

                EventColorEditPageViewModel eventColorViewModel =
                    new EventColorEditPageViewModel(eventColor, viewModel.GetAllGroups(), viewModel.GetAllNames());

                Frame.Navigate(typeof(EventColorEditPage), eventColorViewModel);
                return;
            }

            EventColor newEventColor = new EventColor()
            {
                NameCompareType = CompareType.StartsWith,
                Name            = e.Name,
            };
            EventColorEditPageViewModel newEventColorViewModel =
                new EventColorEditPageViewModel(newEventColor, viewModel.GetAllGroups(), viewModel.GetAllNames());

            viewModel.Settings.EventColors.Collection.Add(newEventColor);
            Frame.Navigate(typeof(EventColorEditPage), newEventColorViewModel);
        }
        private void EleColor_EditClick(object sender, RoutedEventArgs e)
        {
            EventColor eventColor = (EventColor)((FrameworkElement)sender).DataContext;
            EventColorEditPageViewModel eventColorViewModel =
                new EventColorEditPageViewModel(eventColor, viewModel.GetAllGroups(), viewModel.GetAllNames());

            Frame.Navigate(typeof(EventColorEditPage), eventColorViewModel);
        }
        private void BtnAddColor_Click(object sender, RoutedEventArgs e)
        {
            EventColor eventColor = new EventColor();
            EventColorEditPageViewModel eventColorViewModel =
                new EventColorEditPageViewModel(eventColor, viewModel.GetAllGroups(), viewModel.GetAllNames());

            viewModel.Settings.EventColors.Collection.Add(eventColor);

            Frame.Navigate(typeof(EventColorEditPage), eventColorViewModel);
        }