protected override void OnNavigatedTo(NavigationEventArgs e) { ApplicationBar = new ApplicationBar(); ApplicationBar.MatchOverriddenTheme(); ApplicationBar.Mode = ApplicationBarMode.Minimized; ApplicationBarMenuItem MenuItem_HomePage = new ApplicationBarMenuItem(); MenuItem_HomePage.Text = AppResources.HomePageLabel; MenuItem_HomePage.Click += new EventHandler(GoHomePage); ApplicationBarMenuItem MenuItem_Settings = new ApplicationBarMenuItem(); MenuItem_Settings.Text = AppResources.SettingsLabel; MenuItem_Settings.Click += new EventHandler(GoSettings); ApplicationBar.MenuItems.Add(MenuItem_HomePage); ApplicationBar.MenuItems.Add(MenuItem_Settings); ArtistSongs.SelectedItem = null; ArtistAlbums.SelectedItem = null; if (NavigationContext.QueryString.ContainsKey("id")) { int id = Convert.ToInt32(NavigationContext.QueryString["id"]); currentArtist = Database.Artists.SingleOrDefault(x => x.ID == id); if (currentArtist != null) { ArtistDetails.DataContext = currentArtist; GetArtistAlbums(); GetArtistSongs(); } } base.OnNavigatedTo(e); }
/// <summary> /// Creates a new instance of ApplicationBar and applies any /// overridden theme coloring to the instance. /// </summary> /// <returns>Returns a new ApplicationBar instance with its foreground /// and background colors set.</returns> public static ApplicationBar CreateApplicationBar() { var ab = new ApplicationBar(); ab.MatchOverriddenTheme(); return(ab); }
/// <summary> /// Initializes a new instance of the Simon.Library.Controls.AppBar class. /// </summary> public AppBar() { WrappedObject = new ApplicationBar(); WrappedObject.MatchOverriddenTheme(); ButtonList = new List <AppBarIconButton>(); MenuItemList = new List <AppBarMenuItem>(); }
public CreateList() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; }
public User() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; viewModel = new UserModel(); DataContext = viewModel; this.Loaded += (sender, e) => { string userName; if (!NavigationContext.QueryString.TryGetValue("user", out userName)) { NavigationService.GoBack(); return; } viewModel.Loaded(userName); }; viewModel.PropertyChanged += (sender, e) => { if (e.PropertyName == "ScreenName") { TweetList.Resource = new TwitterResource { String = "Tweets:" + viewModel.ScreenName, User = DataTransfer.CurrentAccount }; TweetList.Load(); MentionsList.Resource = new TwitterResource { Data = "@" + viewModel.ScreenName, Type = ResourceType.Search, User = DataTransfer.CurrentAccount }; MentionsList.Load(); } }; TweetList.Loader.PropertyChanged += (sender, e) => { if (e.PropertyName == "IsLoading") { viewModel.IsLoading = TweetList.Loader.IsLoading; } }; MentionsList.Loader.PropertyChanged += (sender, e) => { if (e.PropertyName == "IsLoading") { viewModel.IsLoading = MentionsList.Loader.IsLoading; } }; TweetList.Loader.Cached = false; MentionsList.Loader.Cached = false; }
public Backgrounds() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; DataContext = new BackgroundsModel(); }
public Filters() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; this.Loaded += new RoutedEventHandler(Filters_Loaded); }
public Search() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; viewModel = new ResourceViewModel(); DataContext = viewModel; }
public ManageFilter() { _initialized = false; InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; this.Loaded += new RoutedEventHandler(ManageFilter_Loaded); }
public EnterSearch() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; DataContext = new EnterSearchModel(); SearchQuery.TextChanged += OnTextBoxTextChanged; }
public ColumnView() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; DataContext = new ColumnViewModel(); }
public Topics() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; var viewModel = new TopicsModel(); DataContext = viewModel; viewModel.ShowLocationsPicker += viewModel_ShowLocationsPicker; }
public SelectUser() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; viewModel = new SelectUserModel(); DataContext = viewModel; UserFilter.TextChanged += new TextChangedEventHandler(OnTextBoxTextChanged); this.Loaded += (sender, e) => viewModel.Loaded(); }
public Notifications() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; viewModel = new NotificationsModel(); this.DataContext = viewModel; this.Loaded += (s, e) => viewModel.OnLoad(); }
public ManageDrafts() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; viewModel = new ManageDraftsModel(); DataContext = viewModel; _selectionChangeFired = false; }
protected override void OnNavigatedTo(NavigationEventArgs e) { PageCanvas = new SwipeMenu(this, PageCanvas, LayoutRoot, MoveAnimation, LeftMenu); Container.Height = App.Current.RootVisual.RenderSize.Height; ApplicationBar.MatchOverriddenTheme(); if (Database.Student == null) { MessageBox.Show("Giriş yapmanız gerekiyor.."); NavigationService.Navigate(new Uri("/LoginPage.xaml", UriKind.Relative)); } else { MondayPlan.ItemsSource = Database.LessonPlan.Where(x => x.Day == DayOfWeek.Monday).OrderBy(x => x.BeginDateTime.Hour).ToList(); TuesdayPlan.ItemsSource = Database.LessonPlan.Where(x => x.Day == DayOfWeek.Tuesday).OrderBy(x => x.BeginDateTime.Hour).ToList(); WednesdayPlan.ItemsSource = Database.LessonPlan.Where(x => x.Day == DayOfWeek.Wednesday).OrderBy(x => x.BeginDateTime.Hour).ToList(); ThursdayPlan.ItemsSource = Database.LessonPlan.Where(x => x.Day == DayOfWeek.Thursday).OrderBy(x => x.BeginDateTime.Hour).ToList(); FridayPlan.ItemsSource = Database.LessonPlan.Where(x => x.Day == DayOfWeek.Friday).OrderBy(x => x.BeginDateTime.Hour).ToList(); if (MondayPlan.ItemsSource.Count == 0) { MondayPlan.Visibility = Visibility.Collapsed; MondayEmptyMessage.Visibility = Visibility.Visible; } if (TuesdayPlan.ItemsSource.Count == 0) { TuesdayPlan.Visibility = Visibility.Collapsed; TuesdayEmptyMessage.Visibility = Visibility.Visible; } if (WednesdayPlan.ItemsSource.Count == 0) { WednesdayPlan.Visibility = Visibility.Collapsed; WednesdayEmptyMessage.Visibility = Visibility.Visible; } if (ThursdayPlan.ItemsSource.Count == 0) { ThursdayPlan.Visibility = Visibility.Collapsed; ThursdayEmptyMessage.Visibility = Visibility.Visible; } if (FridayPlan.ItemsSource.Count == 0) { FridayPlan.Visibility = Visibility.Collapsed; FridayEmptyMessage.Visibility = Visibility.Visible; } if (NavigationContext.QueryString.ContainsKey("index")) { LessonPlan.SelectedIndex = Convert.ToInt32(NavigationContext.QueryString["index"].ToString()); } } base.OnNavigatedTo(e); }
public ListManager() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; _selectionChangeFired = false; NewList.Click += new RoutedEventHandler(NewList_Click); _pendingCalls = 0; this.Loaded += new RoutedEventHandler(ListManager_Loaded); }
protected override void OnNavigatedTo(NavigationEventArgs e) { ApplicationBar = new ApplicationBar(); ApplicationBar.MatchOverriddenTheme(); ApplicationBar.Mode = ApplicationBarMode.Minimized; ApplicationBarMenuItem MenuItem_Settings = new ApplicationBarMenuItem(); MenuItem_Settings.Text = AppResources.HomePageLabel; MenuItem_Settings.Click += new EventHandler(GoHomePage); ApplicationBar.MenuItems.Add(MenuItem_Settings); Settings.DataContext = Database.Settings; Countries.ItemsSource = Database.Countries; Countries.SelectedItem = Database.Settings.DefaultCountry; AppVersion.Text = new AssemblyName(Assembly.GetExecutingAssembly().FullName).Version.ToString(); base.OnNavigatedTo(e); }
protected override void OnNavigatedTo(NavigationEventArgs e) { if (NavigationContext.QueryString.ContainsKey("id")) { ApplicationBar = new ApplicationBar(); ApplicationBar.MatchOverriddenTheme(); ApplicationBar.Mode = ApplicationBarMode.Minimized; ApplicationBarMenuItem MenuItem_HomePage = new ApplicationBarMenuItem(); MenuItem_HomePage.Text = AppResources.HomePageLabel; MenuItem_HomePage.Click += new EventHandler(GoHomePage); ApplicationBarMenuItem MenuItem_Settings = new ApplicationBarMenuItem(); MenuItem_Settings.Text = AppResources.SettingsLabel; MenuItem_Settings.Click += new EventHandler(GoSettings); ApplicationBar.MenuItems.Add(MenuItem_HomePage); ApplicationBar.MenuItems.Add(MenuItem_Settings); image = AddToFavorites.Children.First() as Image; text = AddToFavorites.Children.Last() as TextBlock; int id = Convert.ToInt32(NavigationContext.QueryString["id"]); Song song = Database.Songs.SingleOrDefault(x => x.ID == id); if (song != null) { SongDetails.DataContext = currentSong = song; if (Function.isFavorited(currentSong)) { image.Source = new BitmapImage(new Uri("/Assets/favorite_on.png", UriKind.Relative)); text.Text = AppResources.InFavoritesLabel; } if (song.PreviewUrl != null) { Player.Source = new Uri(song.PreviewUrl); PlayerSeekBack.Width = Application.Current.RootVisual.RenderSize.Width - 100; } else { PlayButton.Visibility = Visibility.Collapsed; PlayerSeek.Visibility = Visibility.Collapsed; PlayerSeekBack.Visibility = Visibility.Collapsed; } } } GetMoreSongs(); base.OnNavigatedTo(e); }
public AddColumn() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } viewModel = new AddColumnModel(); DataContext = viewModel; this.Loaded += new RoutedEventHandler(AddColumn_Loaded); }
public MainPage() { _initialised = false; InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; viewModel = new MainPageModel(); DataContext = viewModel; this.Loaded += new RoutedEventHandler(CallLoadFunctions); LastErrorTime = DateTime.MinValue; LastReloadTime = DateTime.MinValue; SetupRecoverDialogGestures(); }
void Tweet_Loaded(object sender, RoutedEventArgs e) { sbShow = this.Resources["sbShow"] as Storyboard; sbHide = this.Resources["sbHide"] as Storyboard; Initialize(); viewModel.OnLoad(); if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } conversation.Loader.PropertyChanged += (s, ea) => { if (ea.PropertyName == "IsLoading") { viewModel.IsLoading = conversation.Loader.IsLoading; } }; }
public Tweet() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; viewModel = new TweetModel(); DataContext = viewModel; this.Loaded += new RoutedEventHandler(Tweet_Loaded); viewModel.TweetSent += (s, e) => { conversation.Loader.Source.Insert(0, e.Payload); TBNoFocus(); }; panorama.SelectionChanged += (sender, e) => { var pano = panorama.SelectedItem as PanoramaItem; if (pano == null) { return; } string tag = pano.Tag as string; if (tag == "conversation" && !conversationLoaded) { conversation.Load(); conversationLoaded = true; } }; }
public NewTweet() { InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } viewModel.TryLoadDraft(); }; DataContext = viewModel; Loaded += NewTweet_Loaded; Unloaded += NewTweet_Unloaded; TweetBox.TextChanged += OnTextBoxTextChanged; GeolocImg.Tap += (sender, e) => { viewModel.IsGeotagged = !viewModel.IsGeotagged; }; viewModel.PropertyChanged += (sender, e) => { if (e.PropertyName == "IsGeotagged") { if (viewModel.IsGeotagged) { Dispatcher.InvokeIfRequired(EnableGeoloc.Begin); } else { Dispatcher.InvokeIfRequired(DisableGeoloc.Begin); } } }; }
public DMConversation() { InitializeComponent(); InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null) { ApplicationBar.MatchOverriddenTheme(); } }; Loaded += new RoutedEventHandler(DMConversation_Loaded); List.Loader.PropertyChanged += (sender, e) => { if (e.PropertyName == "IsLoading") { viewModel.IsLoading = List.Loader.IsLoading; } }; DataContext = viewModel; }
private void CreateApplicationBar() { ApplicationBar = new ApplicationBar(); ApplicationBar.MatchOverriddenTheme(); ApplicationBar.Mode = ApplicationBarMode.Minimized; }
private void This_Loaded(object sender, RoutedEventArgs e) { var vm = (EventPoolViewModel)DataContext; vm.ListenToProperty(x => x.Pool, () => { var buttons = new List <ApplicationBarIconButton>(); var items = new List <ApplicationBarMenuItem>(); // Settings if (vm.Pool.Id == EventPool.RootId) { var button = new ApplicationBarIconButton { IconUri = new Uri("/Assets/Settings.png", UriKind.Relative), Text = PluginResources.SettingsButton }; button.Click += (_, __) => vm.ViewSettingsCommand.Execute(); buttons.Add(button); } // "Right now" if (vm.Pool.Id == EventPool.RootId) { var button = new ApplicationBarIconButton { IconUri = new Uri("/Assets/Now.png", UriKind.Relative), Text = PluginResources.CurrentEventsButton }; button.Click += (_, __) => vm.ShowCurrentEventsCommand.Execute(); buttons.Add(button); } // Filter categories if (vm.FilterByCategoryCommand.CanExecute()) { var item = new ApplicationBarMenuItem { Text = PluginResources.FilterCategoriesButton }; item.Click += (_, __) => vm.FilterByCategoryCommand.Execute(); items.Add(item); } // Filter tags if (vm.FilterByTagCommand.CanExecute()) { var item = new ApplicationBarMenuItem { Text = PluginResources.FilterTagsButton }; item.Click += (_, __) => vm.FilterByTagCommand.Execute(); items.Add(item); } // Scan code if (vm.ScanCodeCommand.CanExecute()) { var button = new ApplicationBarIconButton { IconUri = new Uri("/Assets/Camera.png", UriKind.Relative), Text = PluginResources.ScanCodeButton }; button.Click += (_, __) => vm.ScanCodeCommand.Execute(); buttons.Add(button); } // Send favorite email if (vm.RequestFavoriteEmailCommand.CanExecute()) { var item = new ApplicationBarMenuItem { Text = PluginResources.SendFavoriteEmailButton }; item.Click += (_, __) => vm.RequestFavoriteEmailCommand.ExecuteAsync(); items.Add(item); } ApplicationBar.Buttons.Clear(); ApplicationBar.MenuItems.Clear(); if (buttons.Count + items.Count == 0) { ApplicationBar.IsVisible = false; } else { foreach (var button in buttons) { ApplicationBar.Buttons.Add(button); } foreach (var item in items) { ApplicationBar.MenuItems.Add(item); } ApplicationBar.Mode = buttons.Count == 0 ? ApplicationBarMode.Minimized : ApplicationBarMode.Default; ApplicationBar.MatchOverriddenTheme(); ApplicationBar.IsVisible = true; } }); }