Beispiel #1
0
        /// <summary>
        /// Save biodata to AppData
        /// </summary>
        private void ArchiveData()
        {
            Bio person = App.Current.Resources["person"] as Bio;

            if (person.Photo.Height != 1080.1507568359375) // this is very bad code
            {
                string filename = string.Format("{0}, {1}.png", arg0: person.Name_Last, arg1: person.Name_First);

                SaveBitmapImageToFile(person.Photo, appdir, filename);
            }
        }
Beispiel #2
0
        private void setDesign(Design design)
        {
            //LogoImage.Source = design.logo;
            LogoImage.SetResourceReference(Image.SourceProperty, design.logoref);

            // Background colors
            CardDesign.Background = design.color_bg_primary;
            Sec2Color.Background  = design.color_bg_secondary;

            if (design.isPhoto)
            {
                LogoImage2.Visibility = Visibility.Hidden;

                // Text colors
                NameFirst.Visibility      = Visibility.Visible;
                NameFirst.Foreground      = design.color_text_primary;
                NameLast.Visibility       = Visibility.Visible;
                NameLast.Foreground       = design.color_text_secondary;
                JobDescription.Visibility = Visibility.Visible;
                JobDescription.Foreground = design.color_text_secondary;

                NameFirst.Height = Double.NaN;
            }
            else
            {
                LogoImage2.Visibility = Visibility.Visible;

                NameFirst.Visibility      = Visibility.Hidden;
                NameLast.Visibility       = Visibility.Hidden;
                JobDescription.Visibility = Visibility.Hidden;

                NameFirst.Height = 0;

                LogoImage2.SetResourceReference(Image.SourceProperty, design.logo2ref);

                Bio person        = App.Current.Resources["person"] as Bio;
                Uri unknownPerson = new Uri(@"pack://application:,,,/Resources/img/unkown person.png");
                person.Photo = new BitmapImage(unknownPerson);
            }

            // Clear footer and add new one if present
            Footer.Children.Clear();
            if (design.footer != null)
            {
                Footer.Children.Add(design.footer);
            }
        }