public BookmarkAssistantController (IList<BookmarkManager.Entry> entries) : base ("BookmarkAssistant", NSBundle.MainBundle)
		{
			this.entries = entries;
			this.source = new BookmarkDataSource (entries, AppDelegate.BookmarkManager);
			View.TableView.DataSource = source;
			View.BookmarkDeleted += HandleBookmarkDeleted;
		}
 public BookmarkAssistantController(IList <BookmarkManager.Entry> entries) : base("BookmarkAssistant", NSBundle.MainBundle)
 {
     this.entries = entries;
     this.source  = new BookmarkDataSource(entries, AppDelegate.BookmarkManager);
     View.TableView.DataSource = source;
     View.BookmarkDeleted     += HandleBookmarkDeleted;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Populates the page with content passed during navigation. Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="Common.NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session. The state will be null the first time a page is visited.</param>
        private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            if (e.NavigationParameter == null)
            {
                return;
            }
            try
            {
                var threadId     = (long)e.NavigationParameter;
                var bookmarkdata = new BookmarkDataSource();
                _lastSelectedItem = await
                                    bookmarkdata.BookmarkForumRepository.Items.Where(node => node.ThreadId == threadId).FirstOrDefaultAsync();

                if (_lastSelectedItem != null)
                {
                    Locator.ViewModels.BookmarksPageVm.NavigateToThreadPageViaToastCommand.Execute(_lastSelectedItem);

                    if (AdaptiveStates.CurrentState == NarrowState)
                    {
                        Frame.Navigate(typeof(ThreadPage), null, new DrillInNavigationTransitionInfo());
                    }
                }
            }
            catch (Exception ex)
            {
                AwfulDebugger.SendMessageDialogAsync("Failed to load Bookmarks page", ex);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 単一アプリケーション オブジェクトを初期化します。これは、実行される作成したコードの
        ///最初の行であるため、main() または WinMain() と論理的に等価です。
        /// </summary>
        public App()
        {
            Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync();
            this.InitializeComponent();
            this.Suspending += OnSuspending;
            if (_localSettings.Values.ContainsKey(Constants.ThemeDefault))
            {
                var themeType = (ThemeTypes)_localSettings.Values[Constants.ThemeDefault];
                switch (themeType)
                {
                case ThemeTypes.Light:
                    RequestedTheme = ApplicationTheme.Light;
                    break;

                case ThemeTypes.Dark:
                    RequestedTheme = ApplicationTheme.Dark;
                    break;

                case ThemeTypes.YOSPOS:
                    RequestedTheme = ApplicationTheme.Dark;
                    break;
                }
            }
            SelectedTheme = RequestedTheme;
            try
            {
                DataSource           ds  = new DataSource();
                SaclopediaDataSource sds = new SaclopediaDataSource();
                BookmarkDataSource   bds = new BookmarkDataSource();
                ds.InitDatabase();
                ds.CreateDatabase();
                bds.InitDatabase();
                bds.CreateDatabase();
                sds.InitDatabase();
                sds.CreateDatabase();
            }
            catch
            {
            }
            Container = AutoFacConfiguration.Configure();
        }