Example #1
0
        public ChatSettingsView(ChatModel chat, UserModel user)
        {
            InitializeComponent();

            chatUserViewModel = new ChatSettingsViewModel(chat, user);

            DataContext = chatUserViewModel;

            chatUserViewModel.Closing += (s, e) => Close();
        }
Example #2
0
        /// <summary>
        /// Вызывается перед отображением этой страницы во фрейме.
        /// </summary>
        /// <param name="e">Данные события, описывающие, каким образом была достигнута эта страница.
        /// Этот параметр обычно используется для настройки страницы.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            var    chatID    = (uint)e.Parameter;
            string uniqueKey = CoreHelper.GetChatSettingsUniqueViewModelKey(chatID);

            vm = ServiceLocator.Current.GetInstance <KeyedViewModelLocator>()
                 .GetByKey(uniqueKey, () => new ChatSettingsViewModel(chatID));
            DataContext = vm;
            vm.Activate();

            UsersListView.SelectionChanged += UsersListView_SelectionChanged;
            HardwareButtons.BackPressed    += HardwareButtons_BackPressed;
        }
Example #3
0
 public ChatSettingsView()
 {
     ViewModel = new ChatSettingsViewModel();
     InitializeComponent();
 }