protected override void ApplyNotificationToWindow(Window window, INotification notification)
        {
            PokemonSearchWindowViewModel    content = (PokemonSearchWindowViewModel)window.DataContext;
            PokemonSearchWindowNotification pokemonSearchWindowNotification = (PokemonSearchWindowNotification)notification;

            content.PokemonSearchWindowModel.PokemonId = pokemonSearchWindowNotification.PokemonId;
        }
        protected override void ApplyWindowToNotification(Window windown, INotification notification)
        {
            PokemonSearchWindowViewModel    content = (PokemonSearchWindowViewModel)windown.DataContext;
            PokemonSearchWindowNotification pokemonSearchWindowNotification = (PokemonSearchWindowNotification)notification;

            if (content.PokemonSearchWindowModel.IsChangePokemonId)
            {
                pokemonSearchWindowNotification.PokemonId = content.PokemonSearchWindowModel.PokemonId;
            }
        }
        protected override Window CreateWindow(INotification notification)
        {
            PokemonSearchWindowNotification pokemonSearchWindowNotification = (PokemonSearchWindowNotification)notification;

            // モーダル
            IsModal = pokemonSearchWindowNotification.IsModal;

            // 生成するウィンドウ
            if (pokemonSearchWindowNotification.WindowId == PokemonSearchWindowNotification.POKEMON_SEARCH_WINDOW)
            {
                return(new PokemonSearchWindow());
            }

            //TODO エラー画面を表示する?
            return(new Window());
        }
Пример #4
0
        private void ShowPokemonSearchWindow(object index)
        {
            // ポケモンId取得
            int partyIndex = ObjectConverter.ToInt(index);
            int pokemonId  = _partyManegementModel.GetPokemonId(partyIndex);

            // 通知
            PokemonSearchWindowNotification pokemonSearchWindowNotification = new PokemonSearchWindowNotification();

            pokemonSearchWindowNotification.WindowId  = PokemonSearchWindowNotification.POKEMON_SEARCH_WINDOW;
            pokemonSearchWindowNotification.IsModal   = true;
            pokemonSearchWindowNotification.PokemonId = pokemonId;

            ShowWindowRequest.Raise(pokemonSearchWindowNotification, notification =>
            {
                PokemonSearchWindowNotification resultNotification = (PokemonSearchWindowNotification)notification;
                _partyManegementModel.ChangePokemonId(partyIndex, resultNotification.PokemonId);
            });
        }