当前位置: 首页>>代码示例>>C#>>正文


C# PhoneApplicationPage类代码示例

本文整理汇总了C#中PhoneApplicationPage的典型用法代码示例。如果您正苦于以下问题:C# PhoneApplicationPage类的具体用法?C# PhoneApplicationPage怎么用?C# PhoneApplicationPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PhoneApplicationPage类属于命名空间,在下文中一共展示了PhoneApplicationPage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BusyOverlay

        public BusyOverlay(bool closable, string content = null, bool hideAppBar = true)
        {
            _closable = closable;
            _page = (PhoneApplicationPage)((PhoneApplicationFrame)Application.Current.RootVisual).Content;
            _hideAppBar = hideAppBar;

            _popup = new RadWindow()
            {
                IsAnimationEnabled = false,
                IsClosedOnOutsideTap = false,
                Content = _border = new Border()
                {
                    Opacity = 0.5,
                    Width = _page.ActualWidth,
                    Height = _page.ActualHeight,
                    Background = new SolidColorBrush(_overlayBackgroundColor),
                    Child = new RadBusyIndicator()
                    {
                        IsRunning = true,
                        AnimationStyle = AnimationStyle.AnimationStyle9,
                        VerticalAlignment = VerticalAlignment.Center,
                        HorizontalAlignment = HorizontalAlignment.Stretch,
                        Content = content
                    }
                }
            };

        }
开发者ID:karbazol,项目名称:FBReaderCS,代码行数:28,代码来源:BusyOverlay.cs

示例2: VenueSearchViewModel

        public VenueSearchViewModel(PhoneApplicationPage page)
            : base(page)
        {
            this.Page = page;

            ViewOnMapCommand = new RelayCommand(DoViewOnMap, CanViewOnMap);
        }
开发者ID:travbod57,项目名称:DatingDiary,代码行数:7,代码来源:VenueSearchViewModel.cs

示例3: Go

        public static void Go(PhoneApplicationPage fromPage, Category category)
        {
            SelectionHandler = new PageActionHandler<Category>();
            SelectionHandler.AfterSelected = delegate(Category item)
            {
                if ((item != null) && (item.Id != category.ParentCategoryId))
                {
                    if (category.ParentCategory != null)
                    {
                        category.ParentCategory.Childrens.Remove(category);
                    }

                    category.ParentCategory = item;
                    if (item.Childrens.Count(p => p.Name == category.Name) == 0)
                    {
                        // reset order.
                        category.Order = item.Childrens
                            .Select(p => (int)p.Order).ToList().Max(p => p) + 1;

                        item.Childrens.Add(category);
                    }

                    ((System.Collections.Generic.IEnumerable<AccountItem>)category.AccountItems).ForEach<AccountItem>(p =>
                    {
                        p.RaisePropertyChangd("NameInfo");
                    });
                    ViewModelLocator.CategoryViewModel.Update(category);
                }
            };
            fromPage.NavigateTo("/pages/CategoryManager/SelectParentCategoryPage.xaml?id={0}&currentName={1}&type={2}&childName={3}", new object[] { category.ParentCategoryId, category.ParentCategory == null ? "N/A" : category.ParentCategory.Name, category.CategoryType, category.Name });
        }
开发者ID:RukaiYu,项目名称:TinyMoneyManager.WP8,代码行数:31,代码来源:SelectParentCategoryPage.xaml.cs

示例4: PopupCotainer

 public PopupCotainer(PhoneApplicationPage basePage)
 {
     InitializeComponent();
     this.Loaded += new RoutedEventHandler(PopupCotainer_Loaded);
     _BasePage = basePage;
     _BasePage.BackKeyPress += BasePage_BackKeyPress;
 }
开发者ID:ziibinj,项目名称:DataEncryptWindowsPhoneDemo,代码行数:7,代码来源:PopupCotainer.xaml.cs

示例5: TriggerInvokesCallbacksAfterProcessingReceivedNotifications

        public void TriggerInvokesCallbacksAfterProcessingReceivedNotifications()
        {
            string notificationReceived = "Foo";
            var callbackInvoked = 0;
            var callbackCallsWhenNotificationIsHandled = 0;
            var page = new PhoneApplicationPage();
            var myNotificationAwareObject = new MyNotificationAwareClass();
            var binding = new Binding("InteractionRequest") { Source = myNotificationAwareObject, Mode = BindingMode.OneWay };
            var trigger = new MyTriggerClass
            {
                RequestBinding = binding,
                NotifyAction = c => { notificationReceived = c.Title; callbackCallsWhenNotificationIsHandled = callbackInvoked; }
            };
            Interaction.GetBehaviors(page).Add(trigger);
            var initialState = notificationReceived;
            myNotificationAwareObject.InteractionRequest.Raise(new Notification { Title = "Bar" }, n => callbackInvoked++);
            var barState = notificationReceived;
            myNotificationAwareObject.InteractionRequest.Raise(new Notification { Title = "Finish" }, n => callbackInvoked++);
            var finalState = notificationReceived;

            Assert.AreEqual("Foo", initialState);
            Assert.AreEqual("Bar", barState);
            Assert.AreEqual("Finish", finalState);
            Assert.AreEqual(2, callbackInvoked);
            Assert.AreEqual(1, callbackCallsWhenNotificationIsHandled);
        }
开发者ID:ssethi,项目名称:TestFrameworks,代码行数:26,代码来源:BindableInteractionRequestTriggerBaseFixture.cs

示例6: ClearApplicationBar

 public static void ClearApplicationBar(PhoneApplicationPage page)
 {
     while (page.ApplicationBar.Buttons.Count > 0)
     {
         page.ApplicationBar.Buttons.RemoveAt(0);
     }
 }
开发者ID:uvbs,项目名称:MyProjects,代码行数:7,代码来源:CommonUtils.cs

示例7: SignInPage

        protected internal SignInPage(PhoneApplicationPage page)
            : base(page)
        {
            SignIn = new SimpleActionCommand(_ => SelectServiceProvider.Execute(ClientData.VidyanoServiceProvider));
            RetryConnect = new SimpleActionCommand(async _ =>
            {
                if (State == SignInPageState.NoInternet)
                    await Connect();
            });
            SelectServiceProvider = new SimpleActionCommand(provider =>
            {
                selectedProvider = (ServiceProvider)provider;
                promptServiceProviderWaiter.Set();
            });

            Page.BackKeyPress += (_, e) =>
            {
                promptServiceProviderWaiter.Set();
                if (oauthBrowserWaiter != null)
                    oauthBrowserWaiter.Set();

                if (ClientData != null && !String.IsNullOrEmpty(ClientData.DefaultUserName))
                    e.Cancel = true;
            };
        }
开发者ID:stevehansen,项目名称:vidyano_v1,代码行数:25,代码来源:SignInPage.cs

示例8: ApplicationBarHelper

 public ApplicationBarHelper(PhoneApplicationPage targetPage)
 {
     this.textBoxs = new List<TextBox>();
     this.pageAttached = targetPage;
     this.OriginalBar = pageAttached.ApplicationBar;
     InitializeEditingBar();
 }
开发者ID:RukaiYu,项目名称:TinyMoneyManager.WP8,代码行数:7,代码来源:ApplicationBarHelper.cs

示例9: CommandBehaviorMonitorsCanExecuteChangedToUpdateEnabledWhenCanExecuteChangedIsRaised

        public void CommandBehaviorMonitorsCanExecuteChangedToUpdateEnabledWhenCanExecuteChangedIsRaised()
        {
            var page = new PhoneApplicationPage();
            var bar = new ApplicationBar();
            var button = new ApplicationBarIconButton(new Uri("/foo.png", UriKind.Relative));
            button.Text = "Foo";
            bar.Buttons.Add(button);
            page.ApplicationBar = bar;
            var command = new ApplicationBarButtonCommand();
            command.ButtonText = "Foo";
            var bindingSource = new MyCommandHolder();
            command.CommandBinding = bindingSource.Command;
            Interaction.GetBehaviors(page).Add(command);

            bindingSource.CanExecute = true;

            var initialState = button.IsEnabled;

            bindingSource.CanExecute = false;

            var finalState = button.IsEnabled;

            Assert.IsTrue(initialState);
            Assert.IsFalse(finalState);
        }
开发者ID:selvendiranj,项目名称:compositewpf-copy,代码行数:25,代码来源:ApplicationBarButtonCommandFixture.cs

示例10: UpdateOrientation

        public void UpdateOrientation(PhoneApplicationPage page)
        {
            if (page == null) return;

            //BUG: Auto Rotate >> Landscape >> Disable Auto Rotate >> Still LandScape
            page.SupportedOrientations = Views.SettingView.IsAutoRotate ? SupportedPageOrientation.PortraitOrLandscape : SupportedPageOrientation.Portrait;
        }
开发者ID:5nophilwu,项目名称:S1Nyan,代码行数:7,代码来源:OrientationHelper.cs

示例11: HasSomeThingToDoBeforeGoToMainPage

        /// <summary>
        /// Determines whether [has some thing to do before go to main page].
        /// </summary>
        /// <returns>
        ///   <c>true</c> if [has some thing to do before go to main page]; otherwise, <c>false</c>.
        /// </returns>
        public static bool HasSomeThingToDoBeforeGoToMainPage(PhoneApplicationPage fromPage)
        {
            try
            {
                if (HasSomeThingToDo && App.SeniorVersion == "1530.1222")
                {
                    fromPage.BusyForWork(AppResources.UpgratingUnderProcess);

                    IsolatedAppSetingsHelper.ShowTipsByVerion("DoSomethingOnce", () =>
                    {
                        ViewModelLocator.ScheduleManagerViewModel.SetupPlanningFirstTime();
                        Repayment.UpdateTableStructureAtV1_9_8(ViewModelLocator.AccountBookDataContext, ViewModels.BorrowLeanManager.BorrowLeanViewModel.EnsureStatus);
                    });

                    fromPage.WorkDone();
                }

            }
            catch (Exception)
            {

            }

            return HasSomeThingToDo;
        }
开发者ID:RukaiYu,项目名称:TinyMoneyManager.WP8,代码行数:31,代码来源:UpdatingController.cs

示例12: Insert

 private void Insert()
 {
     // Make an assumption that this is within a phone application that is developed "normally"
     var frame = Application.Current.RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame;
     _page = frame.Content as PhoneApplicationPage;
     _page.BackKeyPress += Page_BackKeyPress;
     // assume the child is a Grid, span all of the rows
     var grid = System.Windows.Media.VisualTreeHelper.GetChild(_page, 0) as Grid;
     if (grid.RowDefinitions.Count > 0)
     {
         Grid.SetRowSpan(this, grid.RowDefinitions.Count);
     }
     grid.Children.Add(this);
     // Create a transition like the regular MessageBox
     SwivelTransition transitionIn = new SwivelTransition();
     transitionIn.Mode = SwivelTransitionMode.BackwardIn;
     // Transition only the MessagePanel
     ITransition transition = transitionIn.GetTransition(MessagePanel);
     transition.Completed += (s, e) => transition.Stop();
     transition.Begin();
     if (_page.ApplicationBar != null)
     {
         // Hide the app bar so they cannot open more message boxes
         _page.ApplicationBar.IsVisible = false;
     }
 }
开发者ID:richardaum,项目名称:Metroist-for-Windows-Phone,代码行数:26,代码来源:MessageBox.xaml.cs

示例13: RestoreState

        public static void RestoreState(PhoneApplicationPage page)
        {
            foreach (PropertyInfo tombstoneProperty in FindTombstoneProperties(page.DataContext))
            {
                string key = "ViewModel." + tombstoneProperty.Name;

                if (page.State.ContainsKey(key))
                {
                    tombstoneProperty.SetValue(page.DataContext, page.State[key], null);
                }
            }

            if (page.State.ContainsKey("FocusedControl.Name"))
            {
                string focusedControlName = (string)page.State["FocusedControl.Name"];
                Control focusedControl = (Control)page.FindName(focusedControlName);

                if (focusedControl != null)
                {
                    page.Loaded += delegate
                    {
                        focusedControl.Focus();
                    };
                }
            }
        }
开发者ID:pieterderycke,项目名称:CloudFox,代码行数:26,代码来源:TombstoneHelper.cs

示例14: Hide

        internal static void Hide(PhoneApplicationPage page)
        {
            SystemTray.SetIsVisible(page, false);
            SystemTray.SetOpacity(page, 1);
            SystemTray.SetProgressIndicator(page, null);

        }
开发者ID:JulianMH,项目名称:DoIt,代码行数:7,代码来源:SystemTrayHelper.cs

示例15: CEDateViewModel

        public CEDateViewModel(PhoneApplicationPage page, int? dateId = null)
            : base(page)
        {
            DateRep = new Repository<Date>(this.Ctx);
            VenueRep = new Repository<Venue>(this.Ctx);

            this.IsEditing = dateId.HasValue;

            if (this.IsEditing)
            {
                this.TheDate = Ctx.Dates.Where(x => x.Id == dateId).SingleOrDefault();
                this.ThePerson = this.TheDate.Person;
                this.TheVenue = this.TheDate.Venue;

                this.Date = DateTime.Parse(this.TheDate.DateOfMeeting.ToShortDateString());
                this.Time = this.Date + this.TheDate.DateOfMeeting.TimeOfDay;
            }
            else
            {
                this.TheDate = new Date();
                this.TheVenue = new Venue();

                this.Date = DateTime.Parse(DateTime.Now.ToShortDateString());
                this.Time = this.Date + DateTime.Now.TimeOfDay;
            }

            this.People = new List<CustomListBoxItem<Person>>();
            this.People.Add(new CustomListBoxItem<Person>() { Key = -1, Value = "Choose ...", Item = null, ShowItem = Visibility.Collapsed });
            this.People.AddRange((from p in Ctx.Persons orderby p.FirstName ascending select new CustomListBoxItem<Person>() { Key = p.Id, Value = p.FullName, Item = p, ShowItem = Visibility.Visible }).ToList());

            // the first one is the Choose item
            foreach (CustomListBoxItem<Person> person in this.People.Skip(1))
                person.Image = Storage.ReadImageFromIsolatedStorageToWriteableBitmap(string.Format("ProfileThumbnail\\{0}", person.Item.FileName));
        }
开发者ID:travbod57,项目名称:DatingDiary,代码行数:34,代码来源:CEDateViewModel.cs


注:本文中的PhoneApplicationPage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。