Beispiel #1
0
        /// <summary>
        /// Executes command
        /// </summary>
        /// <param name="parameter">
        /// Command parameters
        /// </param>
        public override void Execute(object parameter)
        {
            Core.Logger.GetLogger.LogAsync(Core.LogMode.Debug, $"Execute {nameof(SettingCommand)}");

            // open setting window
            Core.Logger.GetLogger.LogAsync(Core.LogMode.Debug, "Open modal Setting window");
            mainWindowViewModel.WindowManager.ShowWindowDialog(nameof(Window.User.Setting), new ViewModel.User.SettingViewModel());

            // update changes
            mainWindowViewModel.UpdateExplicitly(nameof(mainWindowViewModel.User));
        }
        /// <summary>
        /// Executes command
        /// </summary>
        /// <param name="parameter">
        /// Command parameters
        /// <para/>
        /// <paramref name="parameter"/> is an instance of <see cref="Enums.User.FollowMode"/> that determines in which mode window should be opened
        /// </param>
        /// <exception cref="System.ArgumentException">
        /// Throws when <paramref name="parameter"/> is not <see cref="Enums.User.FollowMode"/>
        /// </exception>
        public override void Execute(object parameter)
        {
            Core.Logger.GetLogger.LogAsync(Core.LogMode.Debug, $"Execute {nameof(ShowFollowListCommand)}");

            // gets value that determines in which mode window should be opened
            if (!(parameter is Enums.User.FollowMode))
            {
                throw new System.ArgumentException();
            }
            Enums.User.FollowMode followMode = (Enums.User.FollowMode)parameter;
            Core.Logger.GetLogger.LogAsync(Core.LogMode.Info, $"Follow mode = {followMode}");

            // opens follow window
            Core.Logger.GetLogger.LogAsync(Core.LogMode.Debug, "Open modal Follow window");
            mainWindowViewModel.WindowManager.ShowWindowDialog(key: nameof(Window.User.Follow),
                                                               viewModel: new ViewModel.User.FollowViewModel(followMode));

            // updates main window after closing follow window
            mainWindowViewModel.IsFollowingUpdateExplicitly();
            mainWindowViewModel.UpdateExplicitly(nameof(mainWindowViewModel.User));
        }