Beispiel #1
0
        private async void AppBarButton_Click(object sender, RoutedEventArgs e)
        {
            NB.IsEnabled = true;
            FileOpenPicker fileOpen = new FileOpenPicker();

            fileOpen.FileTypeFilter.Add(".png");
            var file = await fileOpen.PickSingleFileAsync();

            var dest = await ApplicationData.Current.LocalFolder.CreateFolderAsync("Theme", CreationCollisionOption.OpenIfExists);

            try
            {
                var fli = await file.CopyAsync(dest, file.Name, NameCollisionOption.ReplaceExisting);

                LocalTheme.Local.BackIMage[0] = (fli.Path);
                localtheme = LocalTheme.Local;
                try
                {
                    await LocalTheme.write(LocalTheme.TojsonData(localtheme));
                }
                catch
                {
                }
            }
            catch (Exception)
            {
            }
        }
Beispiel #2
0
        private async void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            StorageFolder folder;

            try
            {
                folder = await ApplicationData.Current.LocalFolder.GetFolderAsync("Theme");
            }
            catch
            {
                folder = await ApplicationData.Current.LocalFolder.CreateFolderAsync("Theme");
            }


            List <StorageFile> SL = (await folder.GetFilesAsync()).ToList();

            foreach (var item in SL)
            {
                if ((item.FileType != "json"))
                {
                    break;
                }
                string result = "";
                using (Stream str = await item.OpenStreamForReadAsync())
                {
                    using (StreamReader streamReader = new StreamReader(str))
                    {
                        result = await streamReader.ReadToEndAsync();
                    }
                }

                Themes t = LocalTheme.DeData <Themes>(result);
                them.Add(t);
            }
        }
Beispiel #3
0
        public MainPage()
        {
            LocalTheme.Initialize();
            this.InitializeComponent();

            froot.Navigate(typeof(SetPage), froot);
            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
        }
Beispiel #4
0
        public Guider()
        {
            this.InitializeComponent();



            LocalTheme.Initialize();
        }
Beispiel #5
0
 private async void ColorAuto_Checked(object sender, RoutedEventArgs e)
 {
     try
     {
         LocalTheme.Local.mineColor = "transparent";
         localtheme = LocalTheme.Local;
         await LocalTheme.write(LocalTheme.TojsonData(localtheme));
     }
     catch { }
 }
Beispiel #6
0
 private async void ToggleSwitch_Toggled(object sender, RoutedEventArgs e)
 {
     try
     {
         LocalTheme.Local.IsHighMode = (sender as ToggleSwitch).IsOn;
         localtheme = LocalTheme.Local;
         await LocalTheme.write(LocalTheme.TojsonData(localtheme));
     }
     catch { }
 }
Beispiel #7
0
 public async void OnPropertyChanged([CallerMemberName] string propertyName = null)
 {
     // Raise the PropertyChanged event, passing the name of the property whose value has changed.
     this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
     try
     {
         LocalTheme.Local = localtheme;
         await LocalTheme.write(LocalTheme.TojsonData(localtheme));
     }
     catch { }
 }
Beispiel #8
0
 private async void NB_Toggled(object sender, RoutedEventArgs e)
 {
     LocalTheme.Local.BackIMage[0] = ("ms-appx:///Assets/trans.png");
     localtheme = LocalTheme.Local;
     try
     {
         await LocalTheme.write(LocalTheme.TojsonData(localtheme));
     }
     catch
     {
     }
     NB.IsEnabled = false;
 }
Beispiel #9
0
        private async void cp_ColorChanged(ColorPicker sender, ColorChangedEventArgs args)
        {
            try
            {
                LocalTheme.Local.mineColor = args.NewColor.ToString();
                localtheme = LocalTheme.Local;
                await LocalTheme.write(LocalTheme.TojsonData(localtheme));
            }
            catch
            {
            }

            rect.Fill = new SolidColorBrush(args.NewColor);
        }
Beispiel #10
0
 private async void Page_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         im.Source = new BitmapImage(new Uri((await(LocalTheme.Initialize())).BackIMage[0]));
         SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
     }
     catch (Exception)
     {
         while (true)
         {
             try
             {
                 im.Source = new BitmapImage(new Uri((await(LocalTheme.Initialize())).BackIMage[0]));
                 return;
             }
             catch (Exception)
             {
                 //throw;
             }
         }
     }
 }
Beispiel #11
0
 private async void Gv_ItemClick(object sender, ItemClickEventArgs e)
 {
     LocalTheme.Local = (e.ClickedItem as Themes);
     await LocalTheme.write(LocalTheme.TojsonData(e.ClickedItem));
 }