Beispiel #1
0
 private Singleton()
 {
     picture_count = 1;
     m_db          = Database.Instance;
     ViewModel     = new TodoManager();
     font_color    = new SolidColorBrush(Colors.Black);
 }
Beispiel #2
0
        public NewPage()
        {
            this.InitializeComponent();
            m_singleton         = Singleton.Instance;
            this.ViewModel      = m_singleton.ViewModel;
            NavigationCacheMode = NavigationCacheMode.Enabled;    //缓存页面
            default_image       = new BitmapImage(new Uri("ms-appx:///Assets/picture0.jpg"));
            Frame rootFrame = Window.Current.Content as Frame;

            //rootFrame.Navigated += OnNavigated;
            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
            SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested;
            m_db              = Database.Instance;
            this.SizeChanged += (s, e) =>
            {
                this.create_part.Height = 800 + e.NewSize.Height - 970;
            };
            DataTransferManager.GetForCurrentView().DataRequested += OnShare;
        }
Beispiel #3
0
        public MainPage()
        {
            this.InitializeComponent();
            NavigationCacheMode = NavigationCacheMode.Enabled;    //缓存页面
            default_image       = new BitmapImage(new Uri("ms-appx:///Assets/picture0.jpg"));
            m_singleton         = Singleton.Instance;
            this.ViewModel      = m_singleton.ViewModel;
            m_db = Database.Instance;
            init_item_count();
            pic.DataContext   = "0"; //默认图片
            this.SizeChanged += (s, e) =>
            {
                if (e.NewSize.Width < 1200)
                {
                    this.todo_list.Width = 500 + e.NewSize.Width - 600;
                }
                else
                {
                    this.todo_list.Width = 500;
                }

                this.list_scroll.Height = 600 + e.NewSize.Height - 850;
                this.create_part.Height = 700 + e.NewSize.Height - 850;
            };
            int i = m_db.get_picture_count();

            if (i == -1)
            {
                m_db.init_count();
            }
            else
            {
                m_singleton.set_picture_count(i);
            }
            update_tile();
            DataTransferManager.GetForCurrentView().DataRequested += OnShare;
        }