public void SayHelloCommandChangesText()
        {
            var viewModel = new MainPageViewModel();

            viewModel.SayHelloCommand.Execute();
            Assert.AreEqual("Hello Paket", viewModel.Title);
        }
Example #2
0
        public ShellViewModel()
        {
            MainViewModel = new MainPageViewModel();
            PdfViewModel = new PdfViewModel();
            SettingsViewModel = new SettingsPageViewModel();

            Menu.Add(new MenuItem
            {
                Glyph = "",
                Text = "Library",
                NavigationDestination = typeof (MainPage),
                ViewModel = MainViewModel
            });
            Menu.Add(new MenuItem
            {
                Glyph = "",
                Text = "Viewer",
                NavigationDestination = typeof (PdfPage),
                ViewModel = PdfViewModel
            });
            Menu.Add(new MenuItem
            {
                Glyph = "",
                Text = "Settings",
                NavigationDestination = typeof (SettingsPage),
                ViewModel = SettingsViewModel
            });
        }
        public MainPage()
        {
            InitializeComponent();

            _mainViewModel = new MainPageViewModel();

            BindingContext = _mainViewModel;
        }
Example #4
0
        public Reglage()
        {
            InitializeComponent();
            _viewModel = new MainPageViewModel();
            DataContext = _viewModel;

            this.Loaded += new RoutedEventHandler(Reglage_Loaded);
            Messenger.Default.Register<WindowMessages>(this, _RecieveMessage);
        }
Example #5
0
 public MainPage()
 {
     ViewModel = new MainPageViewModel();
     this.Loaded += async (sender, e) =>
     {
         await Task.Delay(1000);
         await Task.Run(() => ViewModel.InitialiseAsync());
     };
     this.InitializeComponent();
 }
        private void ControlLoaded(object sender, RoutedEventArgs e)
        {
            SetupColors();
            ResolveDependancies();

            _mvvm = (MainPageViewModel) DataContext;

            _mvvm.InitialiseTurtleGraphicsSystem();
            _mvvm.StartTurtleGraphicsSystem();
        }
Example #7
0
        // todo: handle OnNavigated
        public MainPage()
        {
            this.InitializeComponent();
            this.ViewModel = new MainPageViewModel();

            _appServiceClient = new AppServiceClient(
                GATEWAY,
                new TokenExpiredHandler(this.AuthenticateAsync)
                );
        }
        public MainPage()
        {
            InitializeComponent();
            var vm = new MainPageViewModel();

            BindingContext = vm;

            TakePhoto.SetBinding(Button.CommandProperty, "TakePhotoCommand");
            PreviewImage.SetBinding(Image.SourceProperty, "ImageView");
            photoListView.SetBinding(CustomListView.ItemsProperty, "PhotoAlbum");
        }
        public async Task TestRefreshMainListDataWithInvalidData()
        {
            _stubDataService.Setup(x => x.UpdateMainListAsync())
                .Throws(S1UserException.InvalidData);

            var mainPageViewModel = new MainPageViewModel(_stubDataService.Object, null, null, null);

            await mainPageViewModel.RefreshData();

            _stubIndicator.Verify(x => x.SetLoading());
            _stubIndicator.Verify(x => x.SetBusy(false));
        }
Example #10
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            EventAggregator eventAggregator = new EventAggregator();

            DataContext = new MainPageViewModel(
                eventAggregator,
                new CountDownViewModel(Instant.Default),
                new InstantListViewModel(
                    new InstantViewModelFactory(eventAggregator, new TimeToGoNavigationService())));
        }
Example #11
0
        public async Task TestRefreshMainListData()
        {
            _stubDataService.Setup(x => x.UpdateMainListAsync())
                .Returns(() => Task<IList<S1ListItem>>.Factory.StartNew(
                    () => new List<S1ListItem>()));

            var mainPageViewModel = new MainPageViewModel(_stubDataService.Object, null, null, null);

            await mainPageViewModel.RefreshData();

            _stubIndicator.Verify(x => x.SetLoading());
            _stubIndicator.Verify(x => x.SetBusy(false));
        }
Example #12
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new MainPageViewModel();
     MouseMove += new MouseEventHandler(onMouseMove);
     MouseLeftButtonDown += new MouseButtonEventHandler(onMouseLeftButtonDown);
     LocationChanged += new EventHandler(onLocationChanged);
     Activated += (s, a) =>
     {
         updateColor();
         updateScopeImage();
     };
 }
Example #13
0
 public Search(
     ILocationProvider locationProvider,
     ISearchingManager searchingManager,
     CurrentContext currentContext,
     INavigationService navigationService,
     MainPageViewModel mainPageViewModel)
 {
     _locationProvider = locationProvider;
     _searchingManager = searchingManager;
     _currentContext = currentContext;
     _navigationService = navigationService;
     _mainPageViewModel = mainPageViewModel;
 }
Example #14
0
 private void MainPage_Loaded(object sender, RoutedEventArgs e)
 {
     Window.Current.SizeChanged += Current_SizeChanged;
     DetermineVisualState();
     if (DataContext == null)
     {
         _viewmodel = new MainPageViewModel();
     }
     _viewmodel = DataContext as MainPageViewModel;
     if (_viewmodel != null)
     {
         _viewmodel.ShelfVisibility = Visibility.Collapsed;
     }
     UpdateLettersWidths();
 }
Example #15
0
 public MainPage()
 {
     this.InitializeComponent();
     MainPageVM = App.Current.Resources["MainPageVM"] as MainPageViewModel;
     var appView = ApplicationView.GetForCurrentView();
     appView.TitleBar.BackgroundColor = Colors.Black;
     appView.TitleBar.ForegroundColor = Colors.White;
     appView.TitleBar.ButtonBackgroundColor = Colors.Black;
     appView.TitleBar.ButtonForegroundColor = Colors.White;
     var pane = MainPageView.Pane as StackPanel;
     pane.DataContext = MainPageVM.PageList;
     foreach (var item in MainPageVM.PageList)
     {
         var itemElement = new ListViewItem() { DataContext = item, ContentTemplate = (DataTemplate)Resources["ListViewItemDataTemplate"], Tag = item.PageTitle };
         itemElement.Tapped += new TappedEventHandler(ListViewItemTapped);
         pane.Children.Add(itemElement);
     }
 }
            public void TestSample()
            {
                var serviceProvider = CreateServiceProvider();
                var appViewModel = new AppViewModel(serviceProvider);

                MainPageViewModel viewModel = null;
                var action = Execute.OnUIThread(() =>
                {
                    viewModel = new MainPageViewModel(serviceProvider, appViewModel);
                });
                Eventually.ShouldBecomeTrue(() => viewModel != null, DefaultTimeout);

                Eventually.ShouldBecomeTrue(() => viewModel.ConnectionInfo != null, DefaultTimeout);
                viewModel.ConnectionInfoTaskStatus.ShouldEqual(TaskStatus.RanToCompletion);
                viewModel.ConnectionInfo.Address.ToString().ShouldEqual("22.33.44.55");
                viewModel.ConnectionInfo.Network.ToString().ShouldEqual("22.33.44.0/24");

                Eventually.ShouldBecomeTrue(() => viewModel.DhcpInfo != null, DefaultTimeout);
                viewModel.DhcpInfoTaskStatus.ShouldEqual(TaskStatus.RanToCompletion);
                viewModel.DhcpInfo.GatewayAddress.ToString().ShouldEqual("100.101.102.103");
                viewModel.DhcpInfo.DnsServerAddress.ToString().ShouldEqual("200.201.202.203");
                viewModel.DhcpInfo.DomainName.ShouldEqual("my-domain-name");

                Eventually.ShouldBecomeTrue(() => viewModel.ExternalAddress != null, DefaultTimeout);
                viewModel.ExternalAddressTaskStatus.ShouldEqual(TaskStatus.RanToCompletion);
                viewModel.ExternalAddress.ToString().ShouldEqual("50.51.52.53");

                Eventually.ShouldBecomeTrue(() => viewModel.ScanCommand.CanExecute(null), DefaultTimeout);
                Eventually.ShouldBecomeFalse(() => viewModel.CancelScanCommand.CanExecute(null), DefaultTimeout);
                Eventually.ShouldBecomeTrue(() => viewModel.ShowServicesCommand.CanExecute(null), DefaultTimeout);

                viewModel.AvailableServices.ShouldBeEmpty();
                viewModel.ProgressPercent.ShouldEqual(0.0d);
                viewModel.Status.ShouldEqual(String.Empty);

                viewModel.CustomSelectionCommands.Count.ShouldEqual(1);
                viewModel.CustomSelectionCommands.First().Label.ShouldEqual("select whole network");

                viewModel.StartAddressValue.ShouldEqual(IPAddress.Parse("22.33.44.01").Value);
                viewModel.IsStartAddressValid.ShouldBeTrue();
                viewModel.EndAddressValue.ShouldEqual(IPAddress.Parse("22.33.44.254").Value);
                viewModel.IsEndAddressValid.ShouldBeTrue();
            }
Example #17
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (model == null)
            {
                model = new MainPageViewModel();
                DataContext = model;

                if (Service.Settings.AuthUser == null)
                {
                    ShowLogin();
                }
                else if (Service.Settings.CurrentStreamId == 0)
                {
                    LoadDefaultStream();
                }
                else
                {
                    model.CurrentStreamName = Service.Settings.CurrentStreamName;
                    LoadMessages(true);
                }
            }
        }
Example #18
0
 public MainPage()
 {
     InitializeComponent();
     BindingContext = new MainPageViewModel(new DialogService());
 }
Example #19
0
 private static MainPageViewModel CreateViewModel(MainPageArgs args)
 {
     var result = new MainPageViewModel(args.ServiceProvider, args.AppViewModel);
     return result;
 }
Example #20
0
 public MainPage()
 {
     InitializeComponent();
     BindingContext = new MainPageViewModel(Navigation);
 }
 public MainPage()
 {
     InitializeComponent();
     this.BindingContext = this._viewModel = Startup.ServiceProvider.GetService <MainPageViewModel>();
 }
Example #22
0
 public static async Task OpenPathInNewTab(string path)
 {
     await MainPageViewModel.AddNewTabByPathAsync(typeof(PaneHolderPage), path);
 }
Example #23
0
 public MainPage(MainViewModel mainViewModel)
 {
     InitializeComponent();
     DataContext = new MainPageViewModel(mainViewModel);
 }
Example #24
0
 public MainPage(MainPageViewModel model)
 {
     BindingContext = model;
     InitializeComponent();
 }
Example #25
0
    public MainPage()
    {
        var viewModel = new MainPageViewModel();

        BindingContext = viewModel;
 public MainPage(MainPageViewModel viewModel, INavigationStackManager navigationStackManager)
     : base(viewModel, navigationStackManager)
 {
     InitializeComponent();
 }
Example #27
0
 public MainPage()
 {
     this.InitializeComponent();
     ViewModel = ViewModelLocator.Instance.MainPageViewModel;
 }
Example #28
0
        private void ToolbarItem_Clicked(object sender, System.EventArgs e)
        {
            MainPageViewModel foo = this.BindingContext as MainPageViewModel;

            foo.Title = "OK";
        }
Example #29
0
        protected override async void OnActivated(IActivatedEventArgs args)
        {
            await logWriter.InitializeAsync("debug.log");

            Logger.Info($"App activated by {args.Kind.ToString()}");

            await EnsureSettingsAndConfigurationAreBootstrapped();

            var rootFrame = EnsureWindowIsInitialized();

            switch (args.Kind)
            {
            case ActivationKind.Protocol:
                var eventArgs = args as ProtocolActivatedEventArgs;

                if (eventArgs.Uri.AbsoluteUri == "files-uwp:")
                {
                    rootFrame.Navigate(typeof(MainPage), null, new SuppressNavigationTransitionInfo());
                }
                else
                {
                    var parsedArgs     = eventArgs.Uri.Query.TrimStart('?').Split('=');
                    var unescapedValue = Uri.UnescapeDataString(parsedArgs[1]);
                    switch (parsedArgs[0])
                    {
                    case "tab":
                        rootFrame.Navigate(typeof(MainPage), TabItemArguments.Deserialize(unescapedValue), new SuppressNavigationTransitionInfo());
                        break;

                    case "folder":
                        rootFrame.Navigate(typeof(MainPage), unescapedValue, new SuppressNavigationTransitionInfo());
                        break;
                    }
                }

                // Ensure the current window is active.
                Window.Current.Activate();
                Window.Current.CoreWindow.Activated += CoreWindow_Activated;
                return;

            case ActivationKind.CommandLineLaunch:
                var cmdLineArgs    = args as CommandLineActivatedEventArgs;
                var operation      = cmdLineArgs.Operation;
                var cmdLineString  = operation.Arguments;
                var activationPath = operation.CurrentDirectoryPath;

                var parsedCommands = CommandLineParser.ParseUntrustedCommands(cmdLineString);

                if (parsedCommands != null && parsedCommands.Count > 0)
                {
                    async Task PerformNavigation(string payload)
                    {
                        if (!string.IsNullOrEmpty(payload))
                        {
                            payload = CommonPaths.ShellPlaces.Get(payload.ToUpperInvariant(), payload);
                            var folder = (StorageFolder)await FilesystemTasks.Wrap(() => StorageFolder.GetFolderFromPathAsync(payload).AsTask());

                            if (folder != null && !string.IsNullOrEmpty(folder.Path))
                            {
                                payload = folder.Path;     // Convert short name to long name (#6190)
                            }
                        }
                        if (rootFrame.Content != null)
                        {
                            await MainPageViewModel.AddNewTabByPathAsync(typeof(PaneHolderPage), payload);
                        }
                        else
                        {
                            rootFrame.Navigate(typeof(MainPage), payload, new SuppressNavigationTransitionInfo());
                        }
                    }

                    foreach (var command in parsedCommands)
                    {
                        switch (command.Type)
                        {
                        case ParsedCommandType.OpenDirectory:
                        case ParsedCommandType.OpenPath:
                        case ParsedCommandType.ExplorerShellCommand:
                            await PerformNavigation(command.Payload);

                            break;

                        case ParsedCommandType.Unknown:
                            if (command.Payload.Equals("."))
                            {
                                await PerformNavigation(activationPath);
                            }
                            else
                            {
                                var target = Path.GetFullPath(Path.Combine(activationPath, command.Payload));
                                if (!string.IsNullOrEmpty(command.Payload))
                                {
                                    await PerformNavigation(target);
                                }
                                else
                                {
                                    await PerformNavigation(null);
                                }
                            }
                            break;

                        case ParsedCommandType.OutputPath:
                            OutputPath = command.Payload;
                            break;
                        }
                    }

                    if (rootFrame.Content != null)
                    {
                        // Ensure the current window is active.
                        Window.Current.Activate();
                        Window.Current.CoreWindow.Activated += CoreWindow_Activated;
                        return;
                    }
                }
                break;

            case ActivationKind.ToastNotification:
                var eventArgsForNotification = args as ToastNotificationActivatedEventArgs;
                if (eventArgsForNotification.Argument == "report")
                {
                    // Launch the URI and open log files location
                    //SettingsViewModel.OpenLogLocation();
                    SettingsViewModel.ReportIssueOnGitHub();
                }
                break;
            }

            rootFrame.Navigate(typeof(MainPage), null, new SuppressNavigationTransitionInfo());

            // Ensure the current window is active.
            Window.Current.Activate();
            Window.Current.CoreWindow.Activated += CoreWindow_Activated;
        }
Example #30
0
 private void MainPage_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     ViewModel = DataContext as MainPageViewModel;
 }
 public AddApplicationCommand()
 {
     _addAppViewModel   = IoC.Get <AddAppViewModel>();
     _mainPageViewModel = _addAppViewModel.MainPageViewModel;
 }
 public TableViewMenuDemoPage()
 {
     InitializeComponent();
     BindingContext = new MainPageViewModel(this.Navigation);
 }
Example #33
0
        public MainGamePage()
        {
            InitializeComponent();

            BindingContext = new MainPageViewModel();
        }
Example #34
0
 public MainPage()
 {
     InitializeComponent();
     this.ViewModel = new MainPageViewModel();
 }
Example #35
0
 public MainPageViewModelTest()
 {
     mockRepository = new ContactRepositoryMock();
     subject        = new MainPageViewModel(mockRepository);
 }
Example #36
0
 public MainPageView()
 {
     BindingContext = new MainPageViewModel();
     InitializeComponent();
 }
Example #37
0
 protected async void TabView_AddTabButtonClick(TabView sender, object args)
 {
     await MainPageViewModel.AddNewTabAsync();
 }
 public MainPage()
 {
     InitializeComponent();
     DataContext = new MainPageViewModel();
     LogListBox.SelectionChanged += LogListBox_SelectionChanged;
 }
Example #39
0
 public MainPage()
 {
     this.InitializeComponent();
     DataContext = new MainPageViewModel();
 }
Example #40
0
 public MainPage()
 {
     InitializeComponent();
     _mainviewModel = new MainPageViewModel();
     BindingContext = _mainviewModel;
 }
Example #41
0
 public MainPage(User user)
 {
     InitializeComponent();
     BindingContext = vm = new MainPageViewModel(user);
 }
Example #42
0
 public MainPage()
 {
     this.InitializeComponent();
     ViewModel = (MainPageViewModel)DataContext;
 }
Example #43
0
        //private List<Color> _backgroundColors = new List<Color>();

        public MainPage()
        {
            InitializeComponent();

            var model = new MainPageViewModel
            {
                Appetizers = new List <CarouselItem>()
                {
                    // Just create some dummy data here for now.
                    new CarouselItem {
                        ImageSrc = "oranges.png", Name = "ORANGE AWESOMENESS", Price = 120, BackgroundColor = Color.Maroon, StartColor = Color.Maroon, EndColor = Color.Black, Description = "An orange has a tough shiny orange skin. Inside, the fruit is divided into segments, which have thin tough skins that hold together many little sections with juice inside."
                    },                                                                                                                                                                                                                                                                                                                                                            //BackgroundColor= Color.FromHex("#9866d5") //FromHex("#f3463f") //FromHex("#fece49")
                    new CarouselItem {
                        ImageSrc = "tomato.png", Name = "TERRIBLE TOMATO", Price = 129, BackgroundColor = Color.Maroon, StartColor = Color.Maroon, EndColor = Color.Black, Description = " Labelled as a vegetable for nutritional purposes, tomatoes are a good source of vitamin C and the phytochemical lycopene."
                    },                                                                                                                                                                                                                                                                                                       //FromHex("#fab62a")  //FromHex("#fab62a")
                    new CarouselItem {
                        ImageSrc = "pear.png", Name = "PEAR PARTY", Price = 140, BackgroundColor = Color.Maroon, StartColor = Color.Maroon, EndColor = Color.Black, Description = "A pear is a sweet, juicy fruit which is narrow near its stalk, and wider and rounded at the bottom. Pears have white flesh and thin green or yellow skin."
                    }                                                                                                                                                                                                                                                                                                                               //FromHex("#425cfc")  //FromHex("#ccee44")
                },

                Entrées = new List <CarouselItem>()
                {
                    // Just create some dummy data here for now.
                    new CarouselItem {
                        ImageSrc = "oranges.png", Name = "ORANGE AWESOMENESS", Price = 120, BackgroundColor = Color.FromHex("#42a7ff"), StartColor = Color.FromHex("#42a7ff"), EndColor = Color.Black, Description = "An orange has a tough shiny orange skin. Inside, the fruit is divided into segments, which have thin tough skins that hold together many little sections with juice inside."
                    },                                                                                                                                                                                                                                                                                                                                                                                    //FromHex("#f3463f") //FromHex("#fece49")
                    new CarouselItem {
                        ImageSrc = "tomato.png", Name = "TERRIBLE TOMATO", Price = 129, BackgroundColor = Color.FromHex("#42a7ff"), StartColor = Color.FromHex("#42a7ff"), EndColor = Color.Black, Description = " Labelled as a vegetable for nutritional purposes, tomatoes are a good source of vitamin C and the phytochemical lycopene."
                    },                                                                                                                                                                                                                                                                                                                                //FromHex("#fab62a")
                    new CarouselItem {
                        ImageSrc = "pear.png", Name = "PEAR PARTY", Price = 140, BackgroundColor = Color.FromHex("#42a7ff"), StartColor = Color.FromHex("#42a7ff"), EndColor = Color.Black, Description = "A pear is a sweet, juicy fruit which is narrow near its stalk, and wider and rounded at the bottom. Pears have white flesh and thin green or yellow skin."
                    }                                                                                                                                                                                                                                                                                                                                                        //FromHex("#ccee44")
                },

                Desserts = new List <CarouselItem>()
                {
                    // Just create some dummy data here for now.
                    new CarouselItem {
                        ImageSrc = "oranges.png", Name = "ORANGE AWESOMENESS", Price = 120, BackgroundColor = Color.FromHex("#33ccf3"), StartColor = Color.FromHex("#33ccf3"), EndColor = Color.Black, Description = "An orange has a tough shiny orange skin. Inside, the fruit is divided into segments, which have thin tough skins that hold together many little sections with juice inside."
                    },                                                                                                                                                                                                                                                                                                                                                                                    //FromHex("#f3463f") //FromHex("#fece49")
                    new CarouselItem {
                        ImageSrc = "tomato.png", Name = "TERRIBLE TOMATO", Price = 129, BackgroundColor = Color.FromHex("#33ccf3"), StartColor = Color.FromHex("#33ccf3"), EndColor = Color.Black, Description = " Labelled as a vegetable for nutritional purposes, tomatoes are a good source of vitamin C and the phytochemical lycopene."
                    },                                                                                                                                                                                                                                                                                                                                //FromHex("#fab62a")
                    new CarouselItem {
                        ImageSrc = "pear.png", Name = "PEAR PARTY", Price = 140, BackgroundColor = Color.FromHex("#33ccf3"), StartColor = Color.FromHex("#33ccf3"), EndColor = Color.Black, Description = "A pear is a sweet, juicy fruit which is narrow near its stalk, and wider and rounded at the bottom. Pears have white flesh and thin green or yellow skin."
                    }                                                                                                                                                                                                                                                                                                                                                        //FromHex("#ccee44")
                },

                Drinks = new List <CarouselItem>()
                {
                    // Just create some dummy data here for now.
                    new CarouselItem {
                        ImageSrc = "coffee.png", Name = "COFFEE DELIGHT", Price = 120, BackgroundColor = Color.ForestGreen, StartColor = Color.ForestGreen, EndColor = Color.Black, Description = "An orange has a tough shiny orange skin. Inside, the fruit is divided into segments, which have thin tough skins that hold together many little sections with juice inside."
                    },                                                                                                                                                                                                                                                                                                                                                                 //FromHex("#f3463f") //FromHex("#fece49")
                    new CarouselItem {
                        ImageSrc = "marshmallows.png", Name = "GOOEY MARSHMALLOWS", Price = 129, BackgroundColor = Color.ForestGreen, StartColor = Color.ForestGreen, EndColor = Color.Black, Description = " Labelled as a vegetable for nutritional purposes, tomatoes are a good source of vitamin C and the phytochemical lycopene."
                    },                                                                                                                                                                                                                                                                                                                           //FromHex("#fab62a")
                    new CarouselItem {
                        ImageSrc = "strawberry.png", Name = "STRAWBERRY LIVIN", Price = 140, BackgroundColor = Color.ForestGreen, StartColor = Color.ForestGreen, EndColor = Color.Black, Description = "A pear is a sweet, juicy fruit which is narrow near its stalk, and wider and rounded at the bottom. Pears have white flesh and thin green or yellow skin."
                    }                                                                                                                                                                                                                                                                                                                                                      //FromHex("#ccee44")
                }
            };

            BindingContext = model;

            //    // Create out a list of background colors based on our items colors so we can do a gradient on scroll.
            //    for (int i = 0; i < model.Items.Count; i++)
            //    {
            //        var current = model.Items[i];
            //        var next = model.Items.Count > i + 1 ? model.Items[i + 1] : null;

            //        if (next != null)
            //            _backgroundColors.AddRange(SetGradients(current.BackgroundColor, next.BackgroundColor, 375));
            //        else
            //            _backgroundColors.Add(current.BackgroundColor);
            //    }
        }
Example #44
0
 public Main()
 {
     InitializeComponent();
     BindingContext = new MainPageViewModel();
 }
 public MainPage()
 {
     this.InitializeComponent();
     DataContext = new MainPageViewModel();
 }
Example #46
0
 public MainPage(MainPageViewModel viewModel)
 {
     BindingContext = _viewModel = viewModel;
     SetupMauiLayout();
     //SetupCompatibilityLayout();
 }
Example #47
0
 /// <summary>
 /// Searching friends and generating MyFoundedContacts List data
 /// </summary>
 void client_SearchFriendsCompleted(object sender, SearchFriendsCompletedEventArgs e)
 {
     MainPageViewModel contacts = new MainPageViewModel();
     foreach (var result in e.Result)
     {
         contacts.MyFoundedContacts.Add(new ItemViewModel() { FirstName = result.FirstName, LastName = result.LastName, EMail = result.Email, UserName = result.Username, DateOfBirth = result.Age.ToString() });
     }
     FoundedContacts.ItemsSource = contacts.MyFoundedContacts;
 }
 public void SetUp()
 {
     _fakeStopWatch = new FakeStopWatch();
     _mainPageViewModel = new MainPageViewModel(_navigationService);
     _sender = new Object();
 }
 internal void ReCalcPaneFormat()
 {
     var p = Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, new Windows.UI.Core.DispatchedHandler(() =>
      {
          var i = PaneList.SelectedIndex;
          PaneList.SelectionChanged -= PaneList_SelectionChanged;
          DataContext = null;
          DateNowConverter.Refresh();
          DataContext = new MainPageViewModel();
          PaneList.SelectedIndex = i;
          PaneList.SelectionChanged += PaneList_SelectionChanged;
      }));
 }
Example #50
0
        /// <summary>
        /// Called when [startup page completed].
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        private void OnStartupPageCompleted(object sender, Tuple<bool, YouTubeRequest> e)
        {
            var youtubeRequest = e.Item2;

            this.mainPageViewModel = new MainPageViewModel();
            this.mainPageViewModel.ResolveView();
            this.mainPageViewModel.PopulateData(youtubeRequest);
            this.mainPageViewModel.WindowHost = (Window)this.View;
            this.OnPropertyChanged(() => MainPageViewModel);

            var storyboard = ((Storyboard)((Shell)this.View).FindResource("ShowMainPage"));
            storyboard.Begin();
        }
 private void MainWindowOnSizeChanged(object sender, SizeChangedEventArgs e)
 {
     _mvvm = (MainPageViewModel)DataContext;
     _mvvm.CentreDefaultTurtle();
 }
Example #52
0
 public MainPage()
 {
     InitializeComponent();
     AddNewWordButton.Source = ImageSource.FromFile("ImagePlusButton.png");
     BindingContext          = new MainPageViewModel();
 }
 public MainPage()
 {
     InitializeComponent();
     DataContext = new MainPageViewModel();
     //     this.PointerPressed += MainPage_PointerPressed;
 }
Example #54
0
 public MainPage()
 {
     InitializeComponent();
     this.DataContext = viewModel = new MainPageViewModel();
 }
        public void TitleEqualsWelcomeOnConstruction()
        {
            var viewModel = new MainPageViewModel();

            Assert.AreEqual("Welcome", viewModel.Title);
        }
Example #56
0
 public MainPageView()
 {
     InitializeComponent();
     _viewModel  = new MainPageViewModel();
     DataContext = _viewModel;
 }
Example #57
0
 /// <summary>
 /// Geting friends list and generating MyContacts List data
 /// </summary>
 void client_GetFriendsListCompleted(object sender, GetFriendsListCompletedEventArgs e)
 {
     MainPageViewModel contacts = new MainPageViewModel();
     if (e.Result != null)
     {
         foreach (var fr in e.Result)
         {
             contacts.MyContacts.Add(new ItemViewModel { UserName = fr.Username, FirstName = fr.FirstName, LastName = fr.LastName, EMail = fr.Email, DateOfBirth = fr.Age.ToString() });
         }
         Contacts.ItemsSource = contacts.MyContacts;
     }
 }
Example #58
0
 public MainPage()
 {
     BindingContext = new MainPageViewModel(Navigation);
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
 }
Example #59
0
 public MainPage()
 {
     InitializeComponent();
     BindingContext = vm = new MainPageViewModel();
     vm.Navigation  = this.Navigation;
 }
Example #60
0
        /// <summary>
        /// Handles the sign in command.
        /// </summary>
        /// <exception cref="System.NotImplementedException"></exception>
        private void HandleSignInCommand()
        {
            if (this.MainPageViewModel != null)
            {
                this.MainPageViewModel.Dispose();
                this.mainPageViewModel = null;
                this.OnPropertyChanged(() => this.MainPageViewModel);
            }

            var storyboard = ((Storyboard)((Shell)this.View).FindResource("ShowStartupPage"));
            storyboard.Begin();
        }