/// <summary>
 /// Called when this page is navigated to.
 /// Fills out form fields with recognition results.
 /// </summary>
 /// <param name="e"></param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     // call default behaviour
     base.OnNavigatedTo(e);
     // clear form fields
     mContent.Children.Clear();
     // if results have been passed copy them to form fields
     if (results != null) {
         StackPanel typePanel = new StackPanel() { HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, Margin = new Thickness(0, 0, 0, 40) };
         TextBlock typeLabel = new TextBlock() { Text = "Result Type: " + resultsType, HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, TextWrapping = TextWrapping.Wrap, FontSize = 27 };
         typePanel.Children.Add(typeLabel);
         mContent.Children.Add(typePanel);
         foreach (var key in results.Keys) {
             if (key != null && results[key] != null) {
                 StackPanel panel = new StackPanel() { HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, Margin = new Thickness(0, 0, 0, 20) };
                 TextBlock label = new TextBlock() { Text = key, HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, TextWrapping = TextWrapping.Wrap };
                 TextBox textbox = new TextBox() { Text = results[key].ToString(), HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, TextWrapping = TextWrapping.Wrap };
                 panel.Children.Add(label);
                 panel.Children.Add(textbox);
                 mContent.Children.Add(panel);
             }
         }
     } else {
         StackPanel typePanel = new StackPanel() { HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, Margin = new Thickness(0, 0, 0, 40) };
         TextBlock typeLabel = new TextBlock() { Text = "No results found", HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, TextWrapping = TextWrapping.Wrap, FontSize = 27 };
         typePanel.Children.Add(typeLabel);
         mContent.Children.Add(typePanel);
     }
 }
Example #2
0
        public btch_item(stat_home m, int i, String btch_name)
        {
            main = m;
            item = new Grid();
            this.btch_name = btch_name;

            item.Height = 60;
            item.Width = 456;
            item.HorizontalAlignment = HorizontalAlignment.Left;
            item.VerticalAlignment = VerticalAlignment.Top;
            item.Margin = new Thickness(10, 10 + i * 90, 0, 0);

            name = new TextBlock();
            item.Children.Add(name);

            name.Height = 60;
            name.Width = 456;
            name.TextWrapping = TextWrapping.NoWrap;
            name.FontSize = 40;
            name.Margin = new Thickness(0, 0, 0, 0);
            name.Foreground = new SolidColorBrush(Colors.White);
            name.HorizontalAlignment = HorizontalAlignment.Left;
            name.VerticalAlignment = VerticalAlignment.Top;
            name.MouseLeftButtonDown += new MouseButtonEventHandler(expand);

            name.Text = btch_name;

        }
Example #3
0
		public bool Execute()
		{
			Uri fromUri = _fromUriString.ToUri("The from URI was invalid");
			Uri toUri = _toUriString.ToUri("The to URI was invalid");

			IInboundTransport fromTransport = Program.Transports.GetTransport(fromUri);
			IOutboundTransport toTransport = Program.Transports.GetTransport(toUri);

			ITextBlock text = new TextBlock()
				.BeginBlock("Move messages from " + fromUri + " to " + toUri, "");

			int moveCount = 0;
			for (int i = 0; i < _count; i++)
			{
				fromTransport.Receive(receiveContext =>
					{
						return context =>
							{
								var moveContext = new MoveMessageSendContext(context);

								toTransport.Send(moveContext);

								text.BodyFormat("Message-Id: {0}", context.MessageId);

								moveCount++;
							};
					}, TimeSpan.Zero);
			}

			_log.Info(text);
			_log.InfoFormat("{0} message{1} moved from {2} to {3}", moveCount, moveCount == 1 ? "" : "s", fromUri, toUri);

			return true;
		}
Example #4
0
 private static UIElement e_23_Col3_ct_dtMethod(UIElement parent)
 {
     // e_25 element
     StackPanel e_25 = new StackPanel();
     e_25.Parent = parent;
     e_25.Name = "e_25";
     // e_26 element
     TextBlock e_26 = new TextBlock();
     e_25.Children.Add(e_26);
     e_26.Name = "e_26";
     Binding binding_e_26_Text = new Binding("Text");
     e_26.SetBinding(TextBlock.TextProperty, binding_e_26_Text);
     // e_27 element
     StackPanel e_27 = new StackPanel();
     e_25.Children.Add(e_27);
     e_27.Name = "e_27";
     e_27.Orientation = Orientation.Horizontal;
     // e_28 element
     TextBlock e_28 = new TextBlock();
     e_27.Children.Add(e_28);
     e_28.Name = "e_28";
     Binding binding_e_28_Text = new Binding("Boolean");
     e_28.SetBinding(TextBlock.TextProperty, binding_e_28_Text);
     // e_29 element
     TextBlock e_29 = new TextBlock();
     e_27.Children.Add(e_29);
     e_29.Name = "e_29";
     Binding binding_e_29_Text = new Binding("Number");
     e_29.SetBinding(TextBlock.TextProperty, binding_e_29_Text);
     return e_25;
 }
Example #5
0
        // 构造函数
        public MainPage()
        {
            InitializeComponent();

            app.str_Uri = null;

            #region 计时
            txtb_Time = new TextBlock();
            Canvas.SetLeft(txtb_Time, 350);
            Canvas.SetTop(txtb_Time, 0);
            Carrier.Children.Add(txtb_Time);
            this.txtb_Time.Text = count.ToString();//开始时为00:00:00
            this.timer.Tick += Timer_Tick;//时间控件timer,事件Tick,类似线程
            this.timer.Interval = TimeSpan.FromMilliseconds(100);//每100毫秒变化一次
            StartTime = DateTime.UtcNow;
            this.timer.Start();//控件timer开始计时,类似线程开始
            #endregion

            #region 判断是否游戏结束
            dispatcherTimerChecked = new DispatcherTimer();
            dispatcherTimerChecked.Tick += new EventHandler(dispatcherTimerChecked_Tick);
            dispatcherTimerChecked.Interval = TimeSpan.FromMilliseconds(50);
            dispatcherTimerChecked.Start();
            #endregion
        }
Example #6
0
    private void CreateAndShowMainWindow() {
        // Create the application's main window
        mainWindow = new Window();

        // Create a canvas sized to fill the window
        canvas = new Canvas();
        canvas.Background = Brushes.LightSteelBlue;

        // Add a "Hello World!" text element to the Canvas
        TextBlock txt = new TextBlock();
        txt.FontSize = 30;
        txt.TextContent = "Hello World!";
        Canvas.SetTop(txt, 100);
        Canvas.SetLeft(txt, 100);
        canvas.Children.Add(txt);

        Button btn = new Button();
        btn.FontSize = 30;
        btn.Content = "Run Script";
        btn.Click += new RoutedEventHandler(btn_Click);
        Canvas.SetTop(btn, 20);
        Canvas.SetLeft(btn, 100);
        canvas.Children.Add(btn);

        mainWindow.Content = canvas;
        mainWindow.Show();
    }
Example #7
0
 private static UIElement e_28_Col3_ct_dtMethod(UIElement parent)
 {
     // e_30 element
     StackPanel e_30 = new StackPanel();
     e_30.Parent = parent;
     e_30.Name = "e_30";
     // e_31 element
     TextBlock e_31 = new TextBlock();
     e_30.Children.Add(e_31);
     e_31.Name = "e_31";
     Binding binding_e_31_Text = new Binding("Text");
     e_31.SetBinding(TextBlock.TextProperty, binding_e_31_Text);
     // e_32 element
     StackPanel e_32 = new StackPanel();
     e_30.Children.Add(e_32);
     e_32.Name = "e_32";
     e_32.Orientation = Orientation.Horizontal;
     // e_33 element
     TextBlock e_33 = new TextBlock();
     e_32.Children.Add(e_33);
     e_33.Name = "e_33";
     Binding binding_e_33_Text = new Binding("Boolean");
     e_33.SetBinding(TextBlock.TextProperty, binding_e_33_Text);
     // e_34 element
     TextBlock e_34 = new TextBlock();
     e_32.Children.Add(e_34);
     e_34.Name = "e_34";
     Binding binding_e_34_Text = new Binding("Number");
     e_34.SetBinding(TextBlock.TextProperty, binding_e_34_Text);
     return e_30;
 }
Example #8
0
        public void OnDisconnect()
        {
            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
            Progress.Visibility = Visibility.Collapsed;
            if (_connection == null || !_connection._isConnectedFirstTime)
            {
            ContentPanel.Children.Clear();
            TextBlock textBlock = new TextBlock()
            {
            Text = "Connection failed",
            Margin = new Thickness(10, 2, 10, 2),
            FontSize = 20
            };
            Button reconnect = new Button() { Content = "Reconnect" };
            reconnect.BorderThickness = new Thickness(0);
            reconnect.Foreground = new SolidColorBrush(Colors.Black);
            reconnect.Background = new SolidColorBrush(Colors.LightGray);
            reconnect.Click += new RoutedEventHandler(Reconnect_Click);
            ContentPanel.Children.Add(textBlock);
            ContentPanel.Children.Add(reconnect);

            }
            });
        }
        private void ShowBody(Note note)
        {
            this.body.Children.Clear();
            foreach (NoteDetail dett in note.Body)
            {
                if (!string.IsNullOrEmpty(dett.Text))
                {
                    TextBlock block2 = new TextBlock
                    {
                        TextWrapping = TextWrapping.Wrap,
                        FontSize = 40,
                        Foreground = new SolidColorBrush(Colors.Black),
                        Text = dett.Text
                    };
                    TextBlock block = block2;
                    this.body.Children.Add(block);
                }
                else if ((dett.ListPageDraw != null) && (dett.ListPageDraw.Count > 0))
                {
                    ShowDrawingsControl drawings2 = new ShowDrawingsControl
                    {
                        HorizontalAlignment = HorizontalAlignment.Stretch,
                        DataSource = dett.ListPageDraw
                    };
                    ShowDrawingsControl drawings = drawings2;
                    this.body.Children.Add(drawings);
                }
            }

        }
Example #10
0
 void GetGroupTopicCompleted(object s, DoubanSearchCompletedEventArgs args)
 {
     App.GroupTopicViewModel.GetGroupTopicCompleted -= GetGroupTopicCompleted;
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         base.SetProgressIndicator(false);
         if (args.IsSuccess)
         {
             contentContainer.Visibility = Visibility.Visible;
             contentContainer.IsEnabled = true;
             foreach (var content in App.GroupTopicViewModel.TopicContentList)
             {
                 TextBlock tb = new TextBlock();
                 //tb.Width = 445;
                 tb.TextWrapping = TextWrapping.Wrap;
                 tb.Foreground = new SolidColorBrush(Colors.Black);
                 tb.FontSize = (double)App.Current.Resources["PhoneFontSizeMedium"];
                 tb.Text = content;
                 spContent.Children.Add(tb);
             }
             contentContainer.ScrollToVerticalOffset(0);
         }
         else
         {
             ToastPrompt toast = new ToastPrompt();
             toast.Message = args.Message;
             toast.Show();
         }
     }
     );
 }
        void LoadNations()
        {
            int LanguageIndex = edtContentLang.SelectedIndex;
            spNations.Children.Clear();
            nations = MythDB.Instance.Database.Nations.ToList();
            checkBoxes = new List<CheckBox>();
            foreach (Nation n in nations)
            {
                StackPanel sp = new StackPanel();
                sp.Orientation = System.Windows.Controls.Orientation.Horizontal;
                sp.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                sp.VerticalAlignment = System.Windows.VerticalAlignment.Center;

                TextBlock tb = new TextBlock();
                tb.Text = "[" + n.I18nNations[LanguageIndex].ShortName + "] " + n.I18nNations[LanguageIndex].Name;
                tb.FontSize = 20;
                tb.Width = 350;
                tb.VerticalAlignment = System.Windows.VerticalAlignment.Center;
                sp.Children.Add(tb);

                CheckBox cb = new CheckBox();
                cb.IsChecked = n.IsActive;
                cb.VerticalAlignment = System.Windows.VerticalAlignment.Center;
                sp.Children.Add(cb);
                checkBoxes.Add(cb);

                spNations.Children.Add(sp);
            }
        }
Example #12
0
        public static void SetupZoomableText(TextBlock zoomableText)
        {
            zoomableText.Text = @"<<MainPage.cs>>
            namespace SilverlightRunSample.VM
            {
            public class MainPage : SilverlightRun.ViewModel.ColdViewModel<MainPage>
            {
            [SilverlightRun.Tombstoning.SurvivesTombstoning]
            public string Word1 { get; set; }

            [SilverlightRun.Tombstoning.SurvivesRestart]
            public string Word2 { get; set; }

            public MainPage()
            {
            }
            }
            }

            <<ViewModelCenter.cs>>
            using SilverlightRun.DI;

            namespace SilverlightRunSample.VM
            {
            public class ViewModelCenter : SilverlightRun.PhoneSpecific.PhoneTypeCenter
            {
            protected override void ContainerSetup(GenericSimpleContainer container)
            {
            container.DeclareSingleton<VM.MainPage, VM.MainPage>();
            }
            }
            }
            ";
        }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            // We are ready to retreive controls from the template
            this.listBox = this.GetTemplateChild("listBox") as ListBox;
            listBox.ItemsSource = ItemSource;

            this.titleTextBlock = this.GetTemplateChild("DialogTitle") as TextBlock;
            // Assign the values
            this.ItemSource = itemSource;
            this.Title = title;
            if (this.ItemSource != null)
            {
                SelectedIndex = selectedIndex;

                if (listBox.SelectedItem != null)
                    listBox.SetVerticalScrollOffset(SelectedIndex);
            }
            listBox.Opacity = 0;
            // Hook up into listbox's events
            this.listBox.SelectionChanged += new SelectionChangedEventHandler(listBox_SelectionChanged);
            this.listBox.Loaded += new RoutedEventHandler(listBox_Loaded);
            this.listBox.SelectionMode = SelectionMode.Multiple;
        }
Example #14
0
        // Load data from footfall manager
        private void AllRunsPage_Loaded(object sender, RoutedEventArgs e)
        {
            AllPastRuns.Children.Clear();

            foreach (Activity activity in footfallManager.previousRuns)
            {

                StackPanel mainSP = new StackPanel() { Tag = activity, Orientation = System.Windows.Controls.Orientation.Horizontal, Margin = new Thickness(0, 0, 0, 12) };
                mainSP.Tap += new EventHandler<GestureEventArgs>(ViewRun_Tap);

                Image i = new Image() { Height = 99, Source = (ImageSource)(new ImageSourceConverter().ConvertFromString("MapPics/Map1.png")) };

                StackPanel sp = new StackPanel() { Width = 296, Margin = new Thickness(0, 0, 0, 0) };

                TextBlock title = new TextBlock() { Text = activity.title, Style = (Style)App.Current.Resources["PhoneTextLargeStyle"], TextWrapping = TextWrapping.NoWrap };
                TextBlock lineTwo = new TextBlock() { Text = activity.GetLineTwoText(), Style = (Style)App.Current.Resources["PhoneTextNormalStyle"], TextWrapping = TextWrapping.NoWrap };
                TextBlock lineThree = new TextBlock() { Text = activity.GetLineThreeText(), Style = (Style)App.Current.Resources["PhoneTextNormalStyle"], TextWrapping = TextWrapping.NoWrap };

                sp.Children.Add(title);
                sp.Children.Add(lineTwo);
                sp.Children.Add(lineThree);

                mainSP.Children.Add(i);
                mainSP.Children.Add(sp);

                AllPastRuns.Children.Add(mainSP);

            }
        }
Example #15
0
        private async void InitApartments()
        {
            var apartments = await App.MobileService.GetTable<Apartment>().Where(a => a.Published == true).ToListAsync();
            listApartments.ItemsSource = apartments;

            mapApartments.Layers.Clear();
            MapLayer layer = new MapLayer();
            foreach (Apartment apartment in apartments)
            {
                MapOverlay overlay = new MapOverlay();
                overlay.GeoCoordinate = new GeoCoordinate(apartment.Latitude, apartment.Longitude);
                overlay.PositionOrigin = new Point(0, 0);
                Grid grid = new Grid { Height = 40, Width = 25, Background = new SolidColorBrush(Colors.Red) };
                TextBlock text = new TextBlock { Text = apartment.Bedrooms.ToString(), VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center };
                grid.Children.Add(text);
                overlay.Content = grid;
                grid.Tap += (s, e) =>
                {
                    MessageBox.Show(
                        "Address: " + apartment.Address + Environment.NewLine + apartment.Bedrooms + " bedrooms",
                        "Apartment", MessageBoxButton.OK);
                    mapApartments.SetView(overlay.GeoCoordinate, 15, MapAnimationKind.Parabolic);
                };
                layer.Add(overlay);
            }
            mapApartments.Layers.Add(layer);
        }
        public CategoryDetailPage()
        {
            InitializeComponent();

            var textblock = new TextBlock { Text = "header 1", FontSize = 36 };
            var pivotItem = new PivotItem() { Header = textblock };
            var grid = new Grid();
            var listBox = new ListBox()
                              {
                                  HorizontalAlignment = HorizontalAlignment.Stretch,
                                  VerticalAlignment = VerticalAlignment.Stretch,
                                  Margin = new Thickness(0)
                              };
            for (int i = 0; i < 10; i++)
            {
                var newsTitle = new NewsTitleControl();
                listBox.Items.Add(newsTitle);
            }
            grid.Children.Add(listBox);
            pivotItem.Content = grid;
            PivotContainer.Items.Add(pivotItem);
            var textblock2 = new TextBlock { Text = "header 2", FontSize = 36 };
            var pivotItem2 = new PivotItem() { Header = textblock2 };
            PivotContainer.Items.Add(pivotItem2);
        }
 private Grid BuildAddButton()
 {
     Grid g = new Grid();
     g.Width = 120;
     g.Height = 120;
     g.Margin = new Thickness(0, 0, 10, 10);
     Rectangle r = new Rectangle();
     r.Fill = new SolidColorBrush(Color.FromArgb(0x33, 0xFF, 0xFF, 0xFF));
     g.Children.Add(r);
     TextBlock t = new TextBlock();
     t.Text = "+";
     t.VerticalAlignment = VerticalAlignment.Center;
     t.HorizontalAlignment = HorizontalAlignment.Center;
     t.TextAlignment = TextAlignment.Center;
     t.FontSize = 60;
     t.Margin = new Thickness(0, -15, 0, 0);
     g.Children.Add(t);
     Ellipse e = new Ellipse();
     e.Stroke = new SolidColorBrush(Colors.White);
     e.Fill = new SolidColorBrush(Colors.Transparent);
     e.StrokeThickness = 3;
     e.Margin = new Thickness(30);
     g.Children.Add(e);
     return g;
 }
Example #18
0
 private static UIElement r_11_dtMethod(UIElement parent)
 {
     // e_69 element
     Border e_69 = new Border();
     e_69.Parent = parent;
     e_69.Name = "e_69";
     e_69.Background = new SolidColorBrush(new ColorW(0, 0, 255, 255));
     // e_70 element
     StackPanel e_70 = new StackPanel();
     e_69.Child = e_70;
     e_70.Name = "e_70";
     // e_71 element
     TextBlock e_71 = new TextBlock();
     e_70.Children.Add(e_71);
     e_71.Name = "e_71";
     e_71.HorizontalAlignment = HorizontalAlignment.Center;
     e_71.VerticalAlignment = VerticalAlignment.Center;
     Binding binding_e_71_Text = new Binding("TextData");
     e_71.SetBinding(TextBlock.TextProperty, binding_e_71_Text);
     // e_72 element
     Button e_72 = new Button();
     e_70.Children.Add(e_72);
     e_72.Name = "e_72";
     e_72.Content = "Hide Window";
     Binding binding_e_72_Command = new Binding("HideCommand");
     e_72.SetBinding(Button.CommandProperty, binding_e_72_Command);
     return e_69;
 }
Example #19
0
 private void fachpicker_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     Fach f = fachpicker.SelectedItem as Fach;
     if (f.lektion == Lektion.Anderes && f.customfach == null)
     {
         if (fächeradded) { }
         else
         {
             //benutzerdefiniertes Fach
             fächer = new TextBlock() { Text = "Fach: ", FontSize = 34, Margin = new Thickness(7,0,0,0) };
             fächer.SetValue(Grid.RowProperty, 1);
             fächer2 = new TextBox();
             fächer2.SetValue(Grid.RowProperty, 1);
             fächer2.SetValue(Grid.ColumnProperty, 1);
             ContentPanel.Children.Add(fächer);
             ContentPanel.Children.Add(fächer2);
             fächeradded = true;
         }
     }
     else
     {
         Lehrperson.Text = f.Lehrer;
         Farbe.SelectedIndex = f.color;
         if (fächeradded)
         {
             ContentPanel.Children.Remove(fächer);
             ContentPanel.Children.Remove(fächer2);
             fächeradded = false;
         }
     }
 }
Example #20
0
        private void buttonSearch_Click(object sender, RoutedEventArgs e)
        {
            StackPanel containingStackPanel = new StackPanel();
            containingStackPanel.Margin = new Thickness(10, 0, 0, 20);

            int i = 0;

            foreach (RSSFeedItemDetail issue in App.ViewModel.DashboardModelView.GetIssuesBySearchTerm(SearchTerm.Text.Trim()))
            {
                i++;

                TextBlock textblockissueTitle = new TextBlock();
                textblockissueTitle.Text = i.ToString() + " " + issue.Title;
                textblockissueTitle.TextWrapping = TextWrapping.Wrap;
                textblockissueTitle.Style = Resources["PhoneTextNormalStyle"] as Style;
                containingStackPanel.Children.Add(textblockissueTitle);

                TextBlock textblockissueDescription = new TextBlock();
                textblockissueDescription.Text = issue.Description + "\n\n";
                textblockissueDescription.TextWrapping = TextWrapping.Wrap;
                textblockissueDescription.Style = Resources["PhoneTextNormalStyle"] as Style;
                //textblockissuePubDate.Foreground = Resources["PhoneSubtleBrush"] as Brush;
                containingStackPanel.Children.Add(textblockissueDescription);
            }
            ScrollerViewerList.Content = containingStackPanel;
        }
Example #21
0
		public bool Execute()
		{
			Uri uri = _uriString.ToUri("The URI was invalid");

			IDuplexTransport transport = Program.Transports.GetTransport(uri);

			ITextBlock text = new TextBlock()
				.BeginBlock("Requeue messages to " + uri, "");


			int requeueCount = 0;
			for (int i = 0; i < _count; i++)
			{
				transport.Receive(receiveContext =>
					{
						return context =>
							{
								var moveContext = new MoveMessageSendContext(context);

								transport.Send(moveContext);

								text.BodyFormat("Message-Id: {0}", context.MessageId);

								requeueCount++;
							};
					}, TimeSpan.Zero);
			}

			_log.Info(text);
			_log.InfoFormat("{0} message{1} requeued to {2}", requeueCount, requeueCount == 1 ? "" : "s", uri);

			return true;
		}
 public MarkdownList(bool numbered, IEnumerable<UIElement> elements)
 {
     InitializeComponent();
     int number = 1;
     int rowCount = 0;
     foreach (var element in elements)
     {
         theGrid.RowDefinitions.Add(new RowDefinition());
         var text = new TextBlock { TextWrapping = System.Windows.TextWrapping.Wrap, Margin = new Thickness(5, 0, 15, 0), Text = numbered ? (number++).ToString() + "." : "\u25CF" };
         text.SetValue(Grid.RowProperty, rowCount);
         text.SetValue(Grid.ColumnProperty, 0);
         element.SetValue(Grid.RowProperty, rowCount++);
         element.SetValue(Grid.ColumnProperty, 1);
         if (element is RichTextBox)
         {
             element.SetValue(FrameworkElement.MarginProperty, new Thickness(-8, 0, 0, 0));
         }
         else
         {
             element.SetValue(FrameworkElement.MarginProperty, new Thickness(4, 0, 0, 0));
         }
         theGrid.Children.Add(text);
         theGrid.Children.Add(element);
     }
 }
Example #23
0
 public UpdateCell(TextBlock tb, Storyboard sbUp, Storyboard sbDown, Storyboard sbSame)
 {
     this.tb = tb;
     this.sbUp = sbUp;
     this.sbDown = sbDown;
     this.sbSame = sbSame;
 }
Example #24
0
 private async void pageItemDetail_Loaded(object sender, RoutedEventArgs e)
 {
     if (!carregada)
     {
         ItemDto item = await new ItemDto().SearchItemByIDAllData(Convert.ToInt16(NavigationContext.QueryString["id"]));
         imageItem.Source = await item.GetImage();
         textBlockNameItem.Text = item.Name;
         textBlockGoldItem.Text = item.Gold.Total.ToString() + " gold";
         textBlockItemEffect.Text = Code.HtmlRemoval.StripTagsCharArray(item.Description);
         ListBoxReceita.Items.Clear();
         if (item.From != null)
         {
             foreach (string id in item.From)
             {
                 ItemSelect itemSelect = new ItemSelect();
                 itemSelect.Item = await new ItemDto().SearchItemLowData(Convert.ToInt16(id));
                 itemSelect.Tap += ItemSelect_Tap;
                 ListBoxReceita.Items.Add(itemSelect);
             }
         }
         else
         {
             TextBlock tb = new TextBlock();
             tb.FontSize = 30;
             tb.Text = "Este item não possui receita.";
             ListBoxReceita.Items.Add(tb);
         }
         carregada = true;
     }
 }
        protected override void OnSave( TextBlock block )
        {
            base.OnSave( block );

            if( !string.IsNullOrEmpty( diffuseMap ) )
                block.SetAttribute( "diffuseMap", diffuseMap );
        }
        public static string CreateTileBackground(this Project project)
        {
            Grid grid = new Grid();
            Rectangle rect = new Rectangle();
            rect.Width = 173;
            rect.Height = 173;
            rect.Fill = new SolidColorBrush(project.Color.ToColor());

            TextBlock text = new TextBlock();
            text.Text = "TASK";
            text.Foreground = new SolidColorBrush(Colors.White);
            text.FontSize = 32;
            grid.Children.Add(rect);
            grid.Children.Add(text);
            grid.Arrange(new Rect(0d, 0d, 173d, 173d));

            WriteableBitmap wbmp = new WriteableBitmap(grid, null);
            string tiledirectory = "tiles";
            string fullPath = tiledirectory + @"/" + project.Name + ".jpg";
            using (var store = IsolatedStorageFile.GetUserStoreForApplication())
            {

                if (!store.DirectoryExists(tiledirectory))
                {
                    store.CreateDirectory(tiledirectory);
                }

                using (var stream = store.OpenFile(fullPath, System.IO.FileMode.OpenOrCreate))
                {
                    wbmp.SaveJpeg(stream, 173, 173, 0, 100);
                }

            }
            return "isostore:/" + fullPath;
        }
Example #27
0
		public bool Execute()
		{
			Uri uri = _uriString.ToUri("The from URI was invalid");

			IInboundTransport fromTransport = Program.Transports.GetTransport(uri);

			var text = new TextBlock()
				.BeginBlock("Peek URI: " + uri, "");

			int peekCount = 0;
			fromTransport.Receive(receiveContext =>
				{
					if (peekCount >= _count)
						return null;

					var body = Encoding.UTF8.GetString(receiveContext.BodyStream.ReadToEnd());

					text.BeginBlock("MessageId: " + receiveContext.MessageId ?? "", peekCount)
						.Body(body)
						.EndBlock();

					peekCount++;

					return null;
				}, TimeSpan.Zero);

			_log.Info(text.ToString());

			return true;
		}
Example #28
0
        // Load data for the ViewModel Items
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
                //removes back form, used for when navigating from Create NewList.xaml
                NavigationService.RemoveBackEntry();
                if (!App.ViewModel.IsDataLoaded)
                {
                    App.ViewModel.LoadData();

                }
                //Runs everytime program loads,
            
                if (myGlobals.ListofItems.Count == 0) { }
                else
                {
                    //Remove Past TextBlocks
                    ListNamePanel.Children.Clear();

                    //Add TextBlocks to ListColumn
                   // for (int x = 0; x < (myGlobals.ListofItems.Count); x++)
                    foreach(KeyValuePair<string,List<ListObject>> list in myGlobals.ListofItems)
                    {
                        TextBlock ListColumn = new TextBlock();
                        {
                            ListColumn.FontSize = 30;
                            ListColumn.Name = list.Key.ToString();
                            ListColumn.Text = list.Key;

                        };
                        ListNamePanel.Children.Add(ListColumn);
                        ListColumn.Tap += new EventHandler<System.Windows.Input.GestureEventArgs>(HandleTap);
                    }

                    
                }
    }
Example #29
0
 // if you want to rotate any text block ....
 public void Rotate(TextBlock textBlock, int rotationAngleDegrees)
 {
     RotateTransform rTransform = new RotateTransform();
     rTransform.Angle = rotationAngleDegrees;
     textBlock.RenderTransformOrigin = new Point(0.5, 0.5);
     textBlock.RenderTransform = rTransform;
 }
		public override void OnApplyTemplate()
#endif
        {
            base.OnApplyTemplate();

            if (_website != null)
                _website.ManipulationCompleted -= websiteClick_ManipulationCompleted;

            if (_emailAddress != null)
                _emailAddress.ManipulationCompleted -= email_ManipulationCompleted;
            
            _emailAddress = GetTemplateChild(EmailAddressName) as TextBlock;
            _website = GetTemplateChild(WebsiteName) as TextBlock;
            _author = GetTemplateChild(AuthorTxtBlockName) as TextBlock;

            SetVisibility(_emailAddress);
            SetVisibility(_website);
            SetVisibility(_author);

            if (_emailAddress != null)
                _emailAddress.ManipulationCompleted += email_ManipulationCompleted;

            if (_website != null)
                _website.ManipulationCompleted += websiteClick_ManipulationCompleted;
        }