<commit_before>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using ReportsOrganizer.UI.Command;
using ReportsOrganizer.Core.Services;
using ReportsOrganizer.UI.Services;

namespace ReportsOrganizer.UI.ViewModel
{
    public class MainViewModel : BaseViewModel
    {
        INotificationService _notificationService;
        IReportsService _reportsService;
        public ICommand TaskbarIconDoubleClickCommand { get; private set; }
        public ICommand TaskbarIconOpenCommand { get; private set; }
        public ICommand TaskbarIconWriteReportCommand { get; private set; }
        public ICommand TaskbarIconExitCommand { get; private set; }
        public ICommand WindowClosingCommand { get; private set; }
        
        private Visibility windowVisibility;
        public Visibility WindowVisibility
        {
            get
            {
                return windowVisibility;
            }
            set
            {
                windowVisibility = value;
                NotifyPropertyChanged(nameof(WindowVisibility));
            }
        }

        private WindowState prevWindowState;
        private WindowState currentWindowState;
        public WindowState CurrentWindowState
        {
            get
            {
                return currentWindowState;
            }
            set
            {
                prevWindowState = currentWindowState;
                currentWindowState = value;
                NotifyPropertyChanged(nameof(CurrentWindowState));
            }
        }

        public MainViewModel(IReportsService reportsService, INotificationService notificationService)
        {
            TaskbarIconDoubleClickCommand = new RelayCommand(TaskbarIconOpenAction, true);
            TaskbarIconOpenCommand = new RelayCommand(TaskbarIconOpenAction, true);
            TaskbarIconWriteReportCommand = new RelayCommand(TaskbarIconWriteReportAction, true);
            TaskbarIconExitCommand = new RelayCommand(TaskbarIconExitAction, true);
            WindowClosingCommand = new RelayCommand(WindowClosingAction, true);

            

            _reportsService = reportsService;
            _notificationService = notificationService;
        }

        private void TaskbarIconOpenAction(object sender)
        {
            if(WindowState.Minimized == CurrentWindowState)
            {
                CurrentWindowState = prevWindowState;
            }
            WindowVisibility = Visibility.Visible;
        }
<commit_msg>Fixed bug<commit_after>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using ReportsOrganizer.UI.Command;
using ReportsOrganizer.Core.Services;
using ReportsOrganizer.UI.Services;

namespace ReportsOrganizer.UI.ViewModel
{
    public class MainViewModel : BaseViewModel
    {
        INotificationService _notificationService;
        IReportsService _reportsService;
        public ICommand TaskbarIconDoubleClickCommand { get; private set; }
        public ICommand TaskbarIconOpenCommand { get; private set; }
        public ICommand TaskbarIconWriteReportCommand { get; private set; }
        public ICommand TaskbarIconExitCommand { get; private set; }
        public ICommand WindowClosingCommand { get; private set; }
        
        private Visibility windowVisibility;
        public Visibility WindowVisibility
        {
            get
            {
                return windowVisibility;
            }
            set
            {
                windowVisibility = value;
                NotifyPropertyChanged(nameof(WindowVisibility));
            }
        }

        private WindowState prevWindowState;
        private WindowState currentWindowState;
        public WindowState CurrentWindowState
        {
            get
            {
                return currentWindowState;
            }
            set
            {
                prevWindowState = currentWindowState;
                currentWindowState = value;
                NotifyPropertyChanged(nameof(CurrentWindowState));
            }
        }

        public MainViewModel(IReportsService reportsService, INotificationService notificationService)
        {
            TaskbarIconDoubleClickCommand = new RelayCommand(TaskbarIconOpenAction, true);
            TaskbarIconOpenCommand = new RelayCommand(TaskbarIconOpenAction, true);
            TaskbarIconWriteReportCommand = new RelayCommand(TaskbarIconWriteReportAction, true);
            TaskbarIconExitCommand = new RelayCommand(TaskbarIconExitAction, true);
            WindowClosingCommand = new RelayCommand(WindowClosingAction, true);

            

            _reportsService = reportsService;
            _notificationService = notificationService;
        }

        private void TaskbarIconOpenAction(object sender)
        {
            if(WindowState.Minimized == CurrentWindowState)
            {
                CurrentWindowState = prevWindowState;
            }
            WindowVisibility = Visibility.Visible;

            Application.Current.MainWindow.Focus();
        }

{'fraction_non_alphanumeric': 0.05412516444277392, 'fraction_numerical': 0.0, 'mean_word_length': 2.2391965916007304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1462558', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1192, 'n_words': 266}