public AccountItemViewer()
 {
     this.InitializeComponent();
     TiltEffect.SetIsTiltEnabled(this, true);
     this.accountItemViewModel = ViewModelLocator.AccountItemViewModel;
     base.Loaded += new RoutedEventHandler(this.AccountItemViewer_Loaded);
     this.NeedReloadData = true;
     this.accountItemViewerViewModel = new AccountItemViewerViewModel();
     this.RelatedItemsPivot.DataContext = this;
 }
 public AccountItemListPage()
 {
     this.InitializeComponent();
     Microsoft.Unsupported.TiltEffect.SetIsTiltEnabled(this, true);
     base.Loaded += new RoutedEventHandler(this.MainPage_Loaded);
     AccountItemViewer.DeleteItemHandler = new System.Action<AccountItem>(AccountItemListPage.DeleteAccountItem);
     this.accountItemLisViewModel = ViewModelLocator.AccountItemViewModel;
     this.SetTitleTrigger();
     this.SetButtonText();
     this.exportDataOption.EnableChangeSearchingScope = true;
     this.exportDataOption.EnableChangeExportDataMode = true;
     this.exportDataOption.EnableChangeExportDataType = false;
     this.exportDataOption.Subject = LocalizedStrings.GetLanguageInfoByKey("ExpenseIncomeHistoryReport");
     this.exportDataOption.ExportDataType = SummaryDataType.ExpenseOrIncomeRecords;
 }
        public AccountItemViewer()
        {
            this.InitializeComponent();
            TiltEffect.SetIsTiltEnabled(this, true);
            this.accountItemViewModel = ViewModelLocator.AccountItemViewModel;
            base.Loaded += new RoutedEventHandler(this.AccountItemViewer_Loaded);
            this.NeedReloadData = true;
            this.accountItemViewerViewModel = new AccountItemViewerViewModel();

            this.RelatedItemsPivot.DataContext = this;

            var textTitle = new TextBlock();
            textTitle.SetBinding(TextBlock.TextProperty, new System.Windows.Data.Binding("CreateDateInfo"));
            textTitle.Tap += textTitle_Tap;
            MainPivot.Title = textTitle;
        }
        public NewOrEditAccountItemPage()
        {
            System.Action<IApplicationBar> ifTrue = null;
            System.Action<IApplicationBar> ifFalse = null;
            this.accountItemViewModel = ViewModelLocator.AccountItemViewModel;
            this.actionType = PageActionType.Add;
            this.totalDaysOfThisMonth = 30;
            this.InitializeComponent();
            base.ApplicationBar.Opacity = 1.0;
            TiltEffect.SetIsTiltEnabled(this, true);
            this.categoryViewModel = ViewModelLocator.CategoryViewModel;
            base.Loaded += new RoutedEventHandler(this.NewOrEditAccountItemPage_Loaded);
            this.goToPriceInputBoxButton = new ApplicationBarIconButton(IconUirs.CalcutorIconButton);
            this.goToPriceInputBoxButton.Text = AppResources.Calcutor;
            this.goToPriceInputBoxButton.Click += new System.EventHandler(this.goToPriceInputBoxButton_Click);
            this.editingApplicationBarManager = new ApplicationBarHelper(this);
            this.editingApplicationBarManager.SelectContentWhenFocus = true;
            this.editingApplicationBarManager.AddTextBox(new TextBox[] { this.TotalMoneyBox, this.DescriptionTextBox });
            if (ifTrue == null)
            {
                ifTrue = delegate(IApplicationBar p)
                {
                    p.Buttons.Add(this.goToPriceInputBoxButton);
                };
            }
            if (ifFalse == null)
            {
                ifFalse = delegate(IApplicationBar p)
                {
                    p.Buttons.Remove(this.goToPriceInputBoxButton);
                };
            }

            this.editingApplicationBarManager.If(p => p.Name == "TotalMoneyBox", ifTrue, ifFalse);

        }
        public NewOrEditAccountItemPage()
        {
            this.accountItemViewModel = ViewModelLocator.AccountItemViewModel;
            this.actionType = PageActionType.Add;
            this.totalDaysOfThisMonth = 30;
            this.InitializeComponent();
            base.ApplicationBar.Opacity = 1.0;
            TiltEffect.SetIsTiltEnabled(this, true);
            this.categoryViewModel = ViewModelLocator.CategoryViewModel;
            base.Loaded += new RoutedEventHandler(this.NewOrEditAccountItemPage_Loaded);
            this.goToPriceInputBoxButton = new ApplicationBarIconButton(IconUirs.CalcutorIconButton);
            this.goToPriceInputBoxButton.Text = AppResources.Calcutor;
            this.goToPriceInputBoxButton.Click += new System.EventHandler(this.goToPriceInputBoxButton_Click);
            this.editingApplicationBarManager = new ApplicationBarHelper(this);
            this.editingApplicationBarManager.SelectContentWhenFocus = true;
            this.editingApplicationBarManager.AddTextBox(new TextBox[] { this.TotalMoneyBox, this.DescriptionTextBox });

            ViewModelLocator.AccountViewModel.DisableControl = () =>
            {
                this.ApplicationBar.IsMenuEnabled = false;

                if (saveAndContinue != null)
                {
                    this.saveAndContinue.IsEnabled = false;
                }

                if (SaveAndStay != null)
                {
                    this.SaveAndStay.IsEnabled = false;
                }
                if (SaveAndClose != null)
                {
                    this.SaveAndClose.IsEnabled = false;
                }
            };

            AccountName.SelectionChanged += AccountName_SelectionChanged;
            this.editingApplicationBarManager.If(p => p.Name == "TotalMoneyBox", p =>
            {
                goToPriceInputBoxButton.Click -= goToBuildAmountBoxButton_Click;
                goToPriceInputBoxButton.Click += goToPriceInputBoxButton_Click;
                p.Buttons.Add(this.goToPriceInputBoxButton);
            }, p =>
            {
                goToPriceInputBoxButton.Click -= goToPriceInputBoxButton_Click;
                p.Buttons.Remove(this.goToPriceInputBoxButton);
            })
                .If(p => p.Name == DescriptionTextBox.Name, p =>
                {
                    goToPriceInputBoxButton.Click -= goToPriceInputBoxButton_Click;
                    goToPriceInputBoxButton.Click += goToBuildAmountBoxButton_Click;
                    p.Buttons.Add(this.goToPriceInputBoxButton);
                }, p =>
                {
                    goToPriceInputBoxButton.Click -= goToBuildAmountBoxButton_Click;
                    p.Buttons.Remove(this.goToPriceInputBoxButton);
                });
        }