Beispiel #1
0
        private void ListView_SelectionChanged(object sender, Windows.UI.Xaml.Controls.SelectionChangedEventArgs e)
        {
            var vm = new ViewModelLocator().Main;

            vm.CurrentAya = AyaMListView.SelectedItem as AyaElement;
            vm.CurrentAyaIndex = AyaMListView.SelectedIndex;
            Messenger.Default.Send(new NotificationMessage<string>(this, string.Empty, "DetailPage"));
        }
Beispiel #2
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
            //    this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                var vm = new ViewModelLocator().Main;
                vm.ReadProfile();
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
                DispatcherHelper.Initialize();
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }
 private void SfComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     var vm = new ViewModelLocator().Main;
     if (RecitatorNameComboBox.SelectedItem != null)
     {
         var name = vm.RecitatorsNames.ElementAt(RecitatorNameComboBox.SelectedIndex);
         foreach (var key in vm.RecitatorDictionary)
         {
             if (key.Value == name)
             {
                 vm.RecitatorPlaceOnList = RecitatorNameComboBox.SelectedIndex;
                 vm.RecitatorId = key.Key;
                 vm.SetNewRecitator(name);
                 vm.SaveProfile(vm.RecitatorPlaceOnList);
                 return;
             }
                 
         }
         
     }
 }
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            var vm = new ViewModelLocator().Main;
            var obj = value as int?;
            var p = parameter as string;
            switch (p)
            {
                case "p":
                    if (vm.SearchPage == 1)
                    {
                        // disable
                        return false;
                    }
                    else
                    {
                        return true;
                    }
                    break;
                case "n":
                    if (vm.SearchPage >= vm.TotalPages)
                    {
                        // disable
                        return false;
                    }
                    else
                    {
                        return true;
                    }
                    break;
                default:
                    return false;
                    break;

            }
          
        }
 public SettingsFlyout1()
 {
     this.InitializeComponent();
       var vm = new ViewModelLocator().Main;
       RecitatorNameComboBox.Loaded += RecitatorNameComboBox_Loaded;
 }