Exemplo n.º 1
0
 public AboutTheProgramViewModel(UserControl headerControl)
 {
     _headerControl       = headerControl;
     TestCommand          = new DelegateCommand(o => TestSwatches());
     TestButtonVisibility = Settings.Same().ButtonTestVisibility; // ТЕСТОВАЯ КНОПКА
     ResourceManagerService.RegisterManager("AboutTheProgramRes", AboutTheProgramRes.ResourceManager, true);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize a new instance of the <see cref="MainWindowViewModel"/> class
        /// </summary>
        public MainWindowViewModel()
        {
            _model               = new Model.Model(new GameController());
            BeginGameEvent      += BeginGame;
            GenerateFleetCommand = new DelegateCommand(GenerateFleet);
            StartCommand         = new DelegateCommand(Start);
            OkCommand            = new DelegateCommand(Ok);
            InformationCommand   = new DelegateCommand(Information);
            ExitCommand          = new DelegateCommand(Exit);
            TopPlayersCommand    = new DelegateCommand(TopPlayersView);
            GreetingCommand      = new DelegateCommand(Greeting);
            MouseDownCommand     = new DelegateCommand(OnMouseDown);
            UpdateCommand        = new DelegateCommand(Update);
            RussianCommand       = new DelegateCommand(Russian);
            EnglishCommand       = new DelegateCommand(English);
            ShipAmountLeft       = Field.ShipsCount + " ";
            ShipAmountRight      = Field.ShipsCount + " ";
            ShotAmountLeft       = Field.Size * Field.Size + " ";
            ShotAmountRight      = Field.Size * Field.Size + " ";
            ResourceManagerService.RegisterManager("MainWindowRes", MainWindowRes.ResourceManager, true);

            BeforeGame();
            TopPlayersCollection = _model.Players.GetTopTen();
            _model.Game.RandomArrangement(_model.Game.LeftField);
            _model.Game.LeftField.DisplayCompletionCell();
            SetLeftFieldCells();
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initialize a new instance of the <see cref="GreetingViewModel"/> class
 /// </summary>
 public GreetingViewModel()
 {
     CloseCommand   = new DelegateCommand(Close);
     RussianCommand = new DelegateCommand(Russian);
     EnglishCommand = new DelegateCommand(English);
     ResourceManagerService.RegisterManager("MainWindowRes", MainWindowRes.ResourceManager, true);
 }
Exemplo n.º 4
0
        public App() : base()
        {
            // Регистрируем ресурсы локализации
            ResourceManagerService.RegisterManager("MainWindowRes", MainWindowRes.ResourceManager, false);
            ResourceManagerService.RegisterManager("MessageConfirmRes", MessageConfirmRes.ResourceManager, false);
            ResourceManagerService.RegisterManager("ImagesRes", ImagesRes.ResourceManager, false);
            ResourceManagerService.RegisterManager("ContentFoldersRes", ContentFoldersRes.ResourceManager, false);
            ResourceManagerService.RegisterManager("ContentCatalogRes", ContentCatalogRes.ResourceManager, false);
            ResourceManagerService.RegisterManager("ContentCatalogItemsRes", ContentCatalogItemsRes.ResourceManager, false);
            ResourceManagerService.RegisterManager("ContentImageTypesRes", ContentImageTypesRes.ResourceManager, false);
            ResourceManagerService.RegisterManager("ContentVideoTypesRes", ContentVideoTypesRes.ResourceManager, false);
            ResourceManagerService.RegisterManager("ContentCommentsRes", ContentCommentsRes.ResourceManager, false);
            ResourceManagerService.RegisterManager("SettingOptionsRes", SettingOptionsRes.ResourceManager, false);
            ResourceManagerService.RegisterManager("ColorsRes", ColorsRes.ResourceManager, false);
            ResourceManagerService.RegisterManager("TicTacToeRes", TicTacToeRes.ResourceManager, false);
            ResourceManagerService.RegisterManager("DMLRes", DMLRes.ResourceManager, false);

            // Current status
            Settings.Same().AppStatus = TaskStatus.Running;

            this.DispatcherUnhandledException += new DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);
        }
Exemplo n.º 5
0
 protected override void OnStartup(object sender, StartupEventArgs e)
 {
     ResourceManagerService.RegisterManager("MyResources", MyResources.ResourceManager, true);           
     DisplayRootViewFor<LoginViewModel>();
 }
Exemplo n.º 6
0
 public static void Register()
 {
     ResourceManagerService.RegisterManager("XbimPresentationResource", XbimPresentation.ResourceManager, true);
 }
Exemplo n.º 7
0
        /// <summary>
        /// Shows childs windows
        /// </summary>
        /// <param name="pViewIndex"></param>
        /// <param name="pDataContext"></param>
        /// <param name="playerName"></param>
        public static void Show(int pViewIndex, object pDataContext, ref string playerName)
        {
            ResourceManagerService.RegisterManager("MainWindowRes", MainWindowRes.ResourceManager, true);

            Window window;

            switch (pViewIndex)
            {
            case 0:
            {
                window = new GeetingWindow();
                {
                    window.DataContext = new GreetingViewModel();
                    window.ShowDialog();
                    var panel = (Panel)window.Content;
                    foreach (var child in panel.Children)
                    {
                        if (child is TextBox)
                        {
                            playerName = (child as TextBox).Text;
                        }
                    }
                }
                break;
            }

            case 1:
            {
                window = new RatingWindow();

                {
                    var panel = (Panel)window.Content;
                    foreach (var child in panel.Children)
                    {
                        var textColumn  = new DataGridTextColumn();
                        var textColumn1 = new DataGridTextColumn();
                        if (!(child is DataGrid))
                        {
                            continue;
                        }
                        var         childGrid = child as DataGrid;
                        IEnumerable players   = (IEnumerable)pDataContext;
                        (child as DataGrid).ItemsSource = players;
                        textColumn.Header =
                            ResourceManagerService.GetResourceString("MainWindowRes", "Name_Lbl");
                        textColumn.Binding = new Binding("Name");

                        childGrid.Columns.Add(textColumn);
                        textColumn1.Header =
                            ResourceManagerService.GetResourceString("MainWindowRes", "Rating_Lbl");
                        textColumn1.Binding = new Binding("Rating");
                        childGrid.Columns.Add(textColumn1);
                    }


                    window.ShowDialog();
                }
                break;
            }

            default:
                throw new ArgumentOutOfRangeException(nameof(pViewIndex), @"Index out of range");
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// ctor creates instance <see cref="MainWindowViewModel"/>
 /// </summary>
 public MainWindowViewModel()
 {
     ResourceManagerService.RegisterManager("LanguageRes", LanguageRes.ResourceManager, true);
 }