private void btnOK_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            TextStyleItem t = new TextStyleItem();
            t.FontFamilyString = txtSample.FontFamily.Source;
            t.FontSize = txtSample.FontSize;

            DataSystem.CurrentFontStyle = t;

            NavigationService.GoBack();
        }
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            base.OnNavigatingFrom(e);

            if (_selectedText == null) return;
            DataSystem.CurrentColorPicker = (_selectedText.Foreground as SolidColorBrush).Color;
            var t = new TextStyleItem
            {
                FontFamilyString = _selectedText.FontFamily.Source,
                FontSize = _selectedText.FontSize
            };

            DataSystem.CurrentFontStyle = t;

            var idx = _selectedText.Text.IndexOf(' ');
            DataSystem.CurrentText = idx > 0 ? _selectedText.Text.Substring(0, idx) : _selectedText.Text;

            idx = _selectedText.Text.IndexOf('-');
            if (idx > 0)
                DataSystem.CurrentText = DataSystem.CurrentText.Substring(0, idx);

            idx = _selectedText.Text.IndexOf('_');
            if (idx > 0)
                DataSystem.CurrentText = DataSystem.CurrentText.Substring(0, idx);
        }
Example #3
0
 // Code to execute when the application is launching (eg, from Start)
 // This code will not execute when the application is reactivated
 private void Application_Launching(object sender, LaunchingEventArgs e)
 {
     DataSystem.CurrentColorPicker = Color.FromArgb(255, 255, 255, 255);
     TextStyleItem t = new TextStyleItem();
     t.FontFamilyString = "/TypoQuote;component/Fonts/Fonts.zip#Helvetica Neue";
     t.FontSize = 24;
     DataSystem.CurrentFontStyle = t;
 }