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);
        }
示例#2
0
        /// <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);
        }
示例#3
0
        /// <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>();
        }
示例#4
0
 public CreateList()
 {
     InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null)
                                                       {
                                                           ApplicationBar.MatchOverriddenTheme();
                                                       }
     };
 }
示例#5
0
        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;
        }
示例#6
0
        public Backgrounds()
        {
            InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null)
                                                              {
                                                                  ApplicationBar.MatchOverriddenTheme();
                                                              }
            };

            DataContext = new BackgroundsModel();
        }
示例#7
0
        public Filters()
        {
            InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null)
                                                              {
                                                                  ApplicationBar.MatchOverriddenTheme();
                                                              }
            };

            this.Loaded += new RoutedEventHandler(Filters_Loaded);
        }
示例#8
0
 public Search()
 {
     InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null)
                                                       {
                                                           ApplicationBar.MatchOverriddenTheme();
                                                       }
     };
     viewModel   = new ResourceViewModel();
     DataContext = viewModel;
 }
示例#9
0
        public ManageFilter()
        {
            _initialized = false;
            InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null)
                                                              {
                                                                  ApplicationBar.MatchOverriddenTheme();
                                                              }
            };

            this.Loaded += new RoutedEventHandler(ManageFilter_Loaded);
        }
示例#10
0
        public EnterSearch()
        {
            InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null)
                                                              {
                                                                  ApplicationBar.MatchOverriddenTheme();
                                                              }
            };

            DataContext              = new EnterSearchModel();
            SearchQuery.TextChanged += OnTextBoxTextChanged;
        }
示例#11
0
        public ColumnView()
        {
            InitializeComponent();
            Loaded += (sender, e) => { if (ApplicationBar != null)
                                       {
                                           ApplicationBar.MatchOverriddenTheme();
                                       }
            };


            DataContext = new ColumnViewModel();
        }
示例#12
0
        public Topics()
        {
            InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null)
                                                              {
                                                                  ApplicationBar.MatchOverriddenTheme();
                                                              }
            };
            var viewModel = new TopicsModel();

            DataContext = viewModel;
            viewModel.ShowLocationsPicker += viewModel_ShowLocationsPicker;
        }
示例#13
0
        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();
        }
示例#14
0
        public Notifications()
        {
            InitializeComponent(); Loaded += (sender, e) => { if (ApplicationBar != null)
                                                              {
                                                                  ApplicationBar.MatchOverriddenTheme();
                                                              }
            };


            viewModel        = new NotificationsModel();
            this.DataContext = viewModel;
            this.Loaded     += (s, e) => viewModel.OnLoad();
        }
示例#15
0
        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);
        }
示例#17
0
        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);
        }
示例#18
0
        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);
        }
示例#20
0
        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);
        }
示例#21
0
        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();
        }
示例#22
0
        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;
                }
            };
        }
示例#23
0
        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;
                }
            };
        }
示例#24
0
        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);
                    }
                }
            };
        }
示例#25
0
        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;
        }
示例#26
0
 private void CreateApplicationBar()
 {
     ApplicationBar = new ApplicationBar();
     ApplicationBar.MatchOverriddenTheme();
     ApplicationBar.Mode = ApplicationBarMode.Minimized;
 }
示例#27
0
        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;
                }
            });
        }