private DataTemplate CreateItemTemplate()
        {
            var template = new DataTemplate();

            template.VisualTree = new FrameworkElementFactory(typeof(StackPanel));

            var txtBlock = new FrameworkElementFactory(typeof(TextBlock));
            txtBlock.SetBinding(TextBlock.TextProperty, new Binding("Street1")); 
            template.VisualTree.AppendChild(txtBlock);

            txtBlock = new FrameworkElementFactory(typeof(TextBlock));
            txtBlock.SetBinding(TextBlock.TextProperty, new Binding("City")); 
            template.VisualTree.AppendChild(txtBlock);

            var trigger = new MultiDataTrigger();

            trigger.Conditions.Add(
                new Condition(
                    new Binding("Cty"), //misspelling
                    "Tallahassee"
                    )
                );

            trigger.Conditions.Add(
                new Condition(
                    new Binding("StateOrProvince"),
                    "Florida"
                    )
                );

            template.Triggers.Add(trigger);

            return template;
        }
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Talentos_Master;component/frmSeleccionarPrincipal.xaml", System.UriKind.Relative));
     this.Contenedor           = ((System.Windows.Controls.Grid)(this.FindName("Contenedor")));
     this.canvasPuntajesNivel2 = ((System.Windows.Controls.Canvas)(this.FindName("canvasPuntajesNivel2")));
     this.ppPuntajesBuzon1     = ((System.Windows.Controls.Canvas)(this.FindName("ppPuntajesBuzon1")));
     this.canvasPuntajesBuzon1 = ((System.Windows.Controls.Canvas)(this.FindName("canvasPuntajesBuzon1")));
     this.talentosListBox1     = ((System.Windows.Controls.ListBox)(this.FindName("talentosListBox1")));
     this.dt                   = ((System.Windows.DataTemplate)(this.FindName("dt")));
     this.txtCantidad1         = ((System.Windows.Controls.TextBlock)(this.FindName("txtCantidad1")));
     this.txtTotal             = ((System.Windows.Documents.Run)(this.FindName("txtTotal")));
     this.txtVerBuzon3         = ((System.Windows.Controls.TextBlock)(this.FindName("txtVerBuzon3")));
     this.ppPuntajesBuzon2     = ((System.Windows.Controls.Canvas)(this.FindName("ppPuntajesBuzon2")));
     this.canvasPuntajesBuzon2 = ((System.Windows.Controls.Canvas)(this.FindName("canvasPuntajesBuzon2")));
     this.talentosListBox3     = ((System.Windows.Controls.ListBox)(this.FindName("talentosListBox3")));
     this.txtCantidad2         = ((System.Windows.Controls.TextBlock)(this.FindName("txtCantidad2")));
     this.txtTotal2            = ((System.Windows.Documents.Run)(this.FindName("txtTotal2")));
     this.txtVerBuzon1         = ((System.Windows.Controls.TextBlock)(this.FindName("txtVerBuzon1")));
     this.BusyWindow           = ((System.Windows.Controls.BusyIndicator)(this.FindName("BusyWindow")));
     this.ppSeAcabo            = ((System.Windows.Controls.Border)(this.FindName("ppSeAcabo")));
     this.grdSeAcabo           = ((System.Windows.Controls.Grid)(this.FindName("grdSeAcabo")));
     this.txtMensaje           = ((System.Windows.Documents.Run)(this.FindName("txtMensaje")));
     this.btnRevisarSeAcabo    = ((System.Windows.Controls.Border)(this.FindName("btnRevisarSeAcabo")));
     this.btnContinuarSeAcabo  = ((System.Windows.Controls.Border)(this.FindName("btnContinuarSeAcabo")));
 }
Example #3
0
        /// <summary>
        /// Returns the cell data template displaying the member path in a text block.
        /// </summary>
        /// <param name="pDisplayMemberPath">The display member path.</param>
        /// <returns>The built data template.</returns>
        public System.Windows.DataTemplate GetCellTemplate(string pDisplayMemberPath)
        {
            // Trying to get it from the cache.
            System.Windows.DataTemplate lDataTemplate;
            if (this.mCellDataTemplates.TryGetValue(pDisplayMemberPath, out lDataTemplate))
            {
                return(lDataTemplate);
            }

            if (string.IsNullOrEmpty(pDisplayMemberPath) == false)
            {
                // Building dynamically the data template.
                FrameworkElementFactory lTextBlockFactory = new FrameworkElementFactory(typeof(System.Windows.Controls.TextBlock));
                Binding lDisplayMemberBinding             = new Binding(pDisplayMemberPath);
                lTextBlockFactory.SetBinding(System.Windows.Controls.TextBlock.TextProperty, lDisplayMemberBinding);
                lDataTemplate            = new System.Windows.DataTemplate();
                lDataTemplate.VisualTree = lTextBlockFactory;
                lDataTemplate.Seal();

                // Caching the data template.
                this.mCellDataTemplates.Add(pDisplayMemberPath, lDataTemplate);

                return(lDataTemplate);
            }

            // Getting the bind to source data template.
            return(this.mCellDataTemplates[BindToSourceCellDataTemplateKey]);
        }
        public ListColorsEvenElegantlier()
        {
            Title = "List Colors Even Elegantlier";

            DataTemplate template = new DataTemplate(typeof(NamedBrush));
            FrameworkElementFactory factoryStack = new FrameworkElementFactory(typeof(StackPanel));
            factoryStack.SetValue(StackPanel.OrientationProperty, Orientation.Horizontal);
            template.VisualTree = factoryStack;

            FrameworkElementFactory factoryRectangle = new FrameworkElementFactory(typeof(Rectangle));
            factoryRectangle.SetValue(Rectangle.WidthProperty, 16.0);
            factoryRectangle.SetValue(Rectangle.HeightProperty, 16.0);
            factoryRectangle.SetValue(Rectangle.MarginProperty, new Thickness(2));
            factoryRectangle.SetValue(Rectangle.StrokeProperty, SystemColors.WindowTextBrush);
            factoryRectangle.SetBinding(Rectangle.FillProperty, new Binding("Brush"));
            factoryStack.AppendChild(factoryRectangle);

            FrameworkElementFactory factoryTextBlock = new FrameworkElementFactory(typeof(TextBlock));
            factoryTextBlock.SetValue(TextBlock.VerticalAlignmentProperty, VerticalAlignment.Center);
            factoryTextBlock.SetValue(TextBlock.TextProperty, new Binding("Name"));
            factoryStack.AppendChild(factoryTextBlock);

            ListBox lstbox = new ListBox();
            lstbox.Width = 150;
            lstbox.Height = 150;
            Content = lstbox;

            lstbox.ItemTemplate = template;
            lstbox.ItemsSource = NamedBrush.All;

            lstbox.SelectedValuePath = "Brush";
            lstbox.SetBinding(ListBox.SelectedValueProperty, "Background");
            lstbox.DataContext = this;
        }
        public ColorWheel()
        {
            // Define the ItemsPanel template.
            FrameworkElementFactory factoryRadialPanel =
                            new FrameworkElementFactory(typeof(RadialPanel));
            ItemsPanel = new ItemsPanelTemplate(factoryRadialPanel);

            // Create the DataTemplate for the items.
            DataTemplate template = new DataTemplate(typeof(Brush));
            ItemTemplate = template;

            // Create a FrameworkElementFactory based on Rectangle.
            FrameworkElementFactory elRectangle =
                                new FrameworkElementFactory(typeof(Rectangle));
            elRectangle.SetValue(Rectangle.WidthProperty, 4.0);
            elRectangle.SetValue(Rectangle.HeightProperty, 12.0);
            elRectangle.SetValue(Rectangle.MarginProperty,
                                        new Thickness(1, 8, 1, 8));
            elRectangle.SetBinding(Rectangle.FillProperty, new Binding(""));

            // Use that factory for the visual tree.
            template.VisualTree = elRectangle;

            // Set the items in the ListBox.
            PropertyInfo[] props = typeof(Brushes).GetProperties();

            foreach (PropertyInfo prop in props)
                Items.Add((Brush)prop.GetValue(null, null));
        }
        internal static System.Windows.DataTemplate CreateCellTemplate(EntityFieldInfo entityFieldInfo,DataGrid dataGrid)
        {
            DataTemplate dataTemplate = new DataTemplate();
            FrameworkElementFactory contentControl = new FrameworkElementFactory(typeof(ContentControl));
            contentControl.SetBinding(ContentControl.ContentProperty, new Binding());
            Style contentControlStyle = new Style();
            contentControl.SetValue(ContentControl.StyleProperty, contentControlStyle);

            DataTemplate tpl = new DataTemplate();
            if (entityFieldInfo.ControlType == Infrastructure.Attributes.ControlType.Color)
            {
                FrameworkElementFactory grid = new FrameworkElementFactory(typeof(Grid));
                Binding binding = CreateBindingOneWay(entityFieldInfo.Path);
                binding.Converter = new StringToBrushConverter();
                grid.SetBinding(Grid.BackgroundProperty, binding);
                tpl.VisualTree = grid;
                contentControlStyle.Setters.Add(new Setter(ContentControl.ContentTemplateProperty, tpl));
                dataTemplate.VisualTree = contentControl;
            }
            else
            {
                FrameworkElementFactory textBox = new FrameworkElementFactory(typeof(TextBlock));
                if (entityFieldInfo.ControlType == Infrastructure.Attributes.ControlType.Pr)
                { textBox.SetValue(TextBlock.TextAlignmentProperty, TextAlignment.Right); }
                textBox.SetBinding(TextBlock.TextProperty, CreateBindingOneWay(entityFieldInfo.Path));
                tpl.VisualTree = textBox;
                contentControlStyle.Setters.Add(new Setter(ContentControl.ContentTemplateProperty, tpl));
                dataTemplate.VisualTree = contentControl;
            }

            return dataTemplate;
        }
			public override DataTemplate SelectTemplate(object item, DependencyObject container)
			{
				NGTreeNode node = item as NGTreeNode;
				if (node != null)
				{
					if (node.Tag is NamedColor)
					{
						if (null == _namedColorTemplate)
							_namedColorTemplate = (DataTemplate)_parent.TryFindResource("NamedColorTemplate");
						if (null != _namedColorTemplate)
							return _namedColorTemplate;
					}
					else if (node.Tag is IColorSet)
					{
						if (null == _colorSetTemplate)
							_colorSetTemplate = (DataTemplate)_parent.TryFindResource("ColorSetTemplate");
						if (null != _colorSetTemplate)
							return _colorSetTemplate;
					}
					else
					{
						if (null == _treeOtherTemplate)
							_treeOtherTemplate = (DataTemplate)_parent.TryFindResource("TreeOtherTemplate");
						if (null != _treeOtherTemplate)
							return _treeOtherTemplate;
					}
				}

				return base.SelectTemplate(item, container);
			}
Example #8
0
        public HierarchyControl()
        {
            RecursiveSelectedItems = new ObservableCollection<object>();

            //set items panel
            FrameworkElementFactory factoryPanel = new FrameworkElementFactory(typeof(StackPanel));
            factoryPanel.SetValue(StackPanel.IsItemsHostProperty, true);
            ItemsPanelTemplate template = new ItemsPanelTemplate();
            template.VisualTree = factoryPanel;
            ItemsPanel = template;

            //bind parent
            Binding parentBind = new Binding();
            parentBind.RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(HierarchyControl), 1);
            this.SetBinding(ParentHierarchyProperty, parentBind);

            FrameworkElementFactory factoryItem = new FrameworkElementFactory(typeof(HierarchyControl));
            var item_template = new DataTemplate();
            item_template.VisualTree = factoryItem;
            ItemTemplate = item_template;

            //bind intermediate children to items source
            //this.SetBinding(ItemsSourceProperty, new Binding("Children"));

            //drag and drop binds
            this.Loaded += HierarchyControl_Loaded;
            this.Unloaded += HierarchyControl_Unloaded;
            this.GiveFeedback += DragController.Drag_GiveFeedback;

            Binding bind_int = new Binding("IntermediateSource");
            bind_int.RelativeSource = new RelativeSource(RelativeSourceMode.Self);
            this.SetBinding(HierarchyControl.ItemsSourceProperty, bind_int);
            IntermediateSource.CollectionChanged += IntermediateSource_CollectionChanged;
        }
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/PivotApp1;component/MainPage.xaml", System.UriKind.Relative));
     this.myMainPage         = ((Microsoft.Phone.Controls.PhoneApplicationPage)(this.FindName("myMainPage")));
     this.spinner            = ((System.Windows.DataTemplate)(this.FindName("spinner")));
     this.OtteluOtsikko      = ((System.Windows.DataTemplate)(this.FindName("OtteluOtsikko")));
     this.BackFront          = ((Microsoft.Phone.Shell.ApplicationBarIconButton)(this.FindName("BackFront")));
     this.VaihdaLohkoa       = ((Microsoft.Phone.Shell.ApplicationBarIconButton)(this.FindName("VaihdaLohkoa")));
     this.Asetukset          = ((Microsoft.Phone.Shell.ApplicationBarIconButton)(this.FindName("Asetukset")));
     this.LayoutRoot         = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.MainPivot          = ((Microsoft.Phone.Controls.Pivot)(this.FindName("MainPivot")));
     this.OttelutPivot       = ((Microsoft.Phone.Controls.PivotItem)(this.FindName("OttelutPivot")));
     this.PaivanOttelutList  = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("PaivanOttelutList")));
     this.SarjataulukkoList  = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("SarjataulukkoList")));
     this.TilastotList       = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("TilastotList")));
     this.VanhatOttelutPivot = ((Microsoft.Phone.Controls.PivotItem)(this.FindName("VanhatOttelutPivot")));
     this.VanhatOttelutList  = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("VanhatOttelutList")));
     this.TehopisteetList    = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("TehopisteetList")));
     this.PeliAika           = ((System.Windows.Controls.TextBlock)(this.FindName("PeliAika")));
     this.KotiJoukkue        = ((System.Windows.Controls.TextBlock)(this.FindName("KotiJoukkue")));
     this.PeliTulos          = ((System.Windows.Controls.TextBlock)(this.FindName("PeliTulos")));
     this.VierasJoukkue      = ((System.Windows.Controls.TextBlock)(this.FindName("VierasJoukkue")));
     this.OtteluEratulokset  = ((System.Windows.Controls.TextBlock)(this.FindName("OtteluEratulokset")));
     this.OtteluTorjunnat    = ((System.Windows.Controls.TextBlock)(this.FindName("OtteluTorjunnat")));
     this.OtteluGridList     = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("OtteluGridList")));
 }
Example #10
0
 private void AddDataTemplate(Type viewType, Type viewModelType)
 {
     var dataTemplate = new DataTemplate(viewModelType);
     dataTemplate.VisualTree = new FrameworkElementFactory(viewType);
     dataTemplate.Seal();
     App.Current.Resources.Add(new DataTemplateKey(viewModelType), dataTemplate);
 }
 public override DataTemplate SelectTemplate(object item, DependencyObject container)
 {
     DataTemplate tmp = this.Template1;
     this.Template1 = this.Template2;
     this.Template2 = tmp;
     return tmp;
 }
 internal static DataTemplate CreateDefaultTemplate()
 {
     var dataTemplate = new DataTemplate();
     var factory = new FrameworkElementFactory(typeof(ContentPresenter));
     dataTemplate.VisualTree = factory;
     return dataTemplate;
 }
        private void KernelOnComponentRegistered(string key, IHandler handler)
        {
            Type implementation = handler.ComponentModel.Implementation;
            if (implementation.Namespace == null ||
                !implementation.Namespace.EndsWith("ViewModels"))
            {
                return;
            }

            var viewTypeName = implementation.Namespace.Replace("ViewModels", "Views") + "." +
                                implementation.Name.Replace("ViewModel", "View");

            var qualifiedViewTypeName = implementation.AssemblyQualifiedName.Replace(implementation.FullName, viewTypeName);

            Type viewType = Type.GetType(qualifiedViewTypeName, false);
            if (viewType == null)
            {
                throw new InvalidOperationException();
            }

            var dt = new DataTemplate {DataType = viewType};

            var viewFactory = new FrameworkElementFactory(viewType);
            dt.VisualTree = viewFactory;

            _resources.Add(new DataTemplateKey(implementation), dt);
        }
Example #14
0
        public ListBoxHandler()
        {
            Control = new swc.ListBox();
            Control.HorizontalAlignment = sw.HorizontalAlignment.Stretch;
            //Control.DisplayMemberPath = "Text";
            var template = new sw.DataTemplate();

            template.VisualTree       = new WpfImageTextBindingBlock(() => Widget.TextBinding, () => Widget.ImageBinding, false);
            Control.ItemTemplate      = template;
            Control.SelectionChanged += delegate
            {
                Callback.OnSelectedIndexChanged(Widget, EventArgs.Empty);
            };
            Control.MouseDoubleClick += delegate
            {
                if (SelectedIndex >= 0)
                {
                    Callback.OnActivated(Widget, EventArgs.Empty);
                }
            };
            Control.KeyDown += (sender, e) =>
            {
                if (e.Key == sw.Input.Key.Return)
                {
                    if (SelectedIndex >= 0)
                    {
                        Callback.OnActivated(Widget, EventArgs.Empty);
                        e.Handled = true;
                    }
                }
            };
        }
Example #15
0
        /// <summary>
        /// Gets the visual representation of the contents of this container. If it is 
        /// a single pushpin, the pushpin itself is returned. If multiple pushpins are present
        /// a pushpin with the given clusterTemplate is returned.
        /// </summary>
        public FrameworkElement GetElement(DataTemplate clusterTemplate)
        {
            if (_pushpins.Count == 1)
              {
            return _pushpins[0];

              }
              else
              {
              Pushpin pp = new Pushpin()
            {
              Location = _pushpins.First().Location,
              Content = /*_pushpins.Select(pin => pin.DataContext).Count().ToString()*/_pushpins.Count.ToString(),
              ContentTemplate = clusterTemplate,
              Tag =  _pushpins,
              Background = new SolidColorBrush(Colors.Red)

            };

              pp.MouseLeftButtonUp += (s, e) => {
                                              Pushpin p  = (Pushpin)s;
                                                List<Pushpin> lp = (List<Pushpin>)p.Tag;
                                              MessageBox.Show(lp.Count().ToString());
              };
              return pp;
              }
        }
Example #16
0
 public ListViewSorter(ListView listView, DefaultHeaderSortDirections defaultHeaderSortDirections, DataTemplate upArrow, DataTemplate downArrow)
 {
     this.listView = listView;
     this.defaultHeaderSortDirections = defaultHeaderSortDirections;
     this.upArrow = upArrow;
     this.downArrow = downArrow;
 }
            public bool TrySelectTemplate(
                object item,
                DependencyObject container,
                string context,
                bool isTooltip,
                out DataTemplate dataTemplate)
            {
                dataTemplate = null;

                if (DataTemplateProvider == null)
                    return false;

                if (item == null)
                    return false;

                var cached_item = (object)null;

                if(Item.TryGetTarget(out cached_item))
                {
                    if (cached_item == null)
                        return false;

                    if (cached_item.GetType() != item.GetType())
                        return false;
                }

                if (!string.Equals(Context, context))
                    return false;

                return DataTemplateProvider.TrySelectTemplate(item, container, context, isTooltip, out dataTemplate);
            }
        private void GenerateByXmlReader_Click(object sender, RoutedEventArgs e)
        {
            //通过xml生成控件
            //xml无法添加事件,需要在完成控件添加后,查询到控件,添加事件方法
            //https://stackoverflow.com/questions/46522636/how-generate-custom-columns-for-frameworkelementfactorytypeofdatagrid

            var dataTemplateString =
                @" <DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"" 
                                        xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
                            <StackPanel Orientation=""Horizontal"">
                                <Button Content=""修改"" x:Name=""mButton""></Button>
                                <Button Content=""删除""></Button>
                            </StackPanel>
                        </DataTemplate>";

            var       stringReader = new StringReader(dataTemplateString);
            XmlReader xmlReader    = XmlReader.Create(stringReader);

            System.Windows.DataTemplate dataTemplate = (System.Windows.DataTemplate)XamlReader.Load(xmlReader);
            DataGridTemplateColumn      col1         = new DataGridTemplateColumn();

            col1.CellTemplate = dataTemplate;
            dataGrid2.Columns.Add(col1);
            //button 事件 查找控件加载
            //https://stackoverflow.com/questions/8666522/xamlreader-with-click-event
            //Find the DataRowView for DataGrid.
        }
        // <summary>
        // Basic ctor
        // </summary>
        // <param name="property">Property to display</param>
        // <param name="valueDialogTemplate">Template to use</param>
        public PropertyValueDialogControl(PropertyEntry property, DataTemplate valueDialogTemplate) 
        {
            Fx.Assert(property != null, "property parameter is null");
            Fx.Assert(valueDialogTemplate != null, "valueDialogTemplate parameter is null");

            ModelPropertyEntry modelPropertyValue = property as ModelPropertyEntry;
            if (modelPropertyValue != null) 
            {
                _rootTransaction = modelPropertyValue.FirstModelProperty.Value.BeginEdit();
            }

            InitializeComponent();

            // Make sure we use PI-specific resources within this control
            this.Resources.MergedDictionaries.Add(PropertyInspectorResources.GetResources());

            // Hook into an opening of nested dialogs.  PropertyInspector class takes care of this for us.
            // However, we are using Blend's collection editor which doesn't do the same thing, so
            // we need to reproduce that behavior manually.
            PropertyValueDialogHost.AttachOpenDialogHandlers(this);

            // Hook into the standard set of Commands
            _defaultCommandHandler = new PropertyValueEditorCommandHandler(this);


            _OKButton.Click += new RoutedEventHandler(OnOkButtonClicked);
            _cancelButton.Click += new RoutedEventHandler(OnCancelButtonClicked);
            _contentControl.Content = property.PropertyValue;
            _contentControl.ContentTemplate = valueDialogTemplate;

            //Handle the commit and cancel keys within the property inspector, that is hosted in the collection editor
            ValueEditorUtils.SetHandlesCommitKeys(this, true);

        }
Example #20
0
		public DataTemplateAdorner(object data, UIElement adornedElement, DataTemplate dataTemplate)
			: base(adornedElement) {
			_contentPresenter = new ContentPresenter() {
				Content = data,
				ContentTemplate = dataTemplate,
			};
		}
Example #21
0
		public static ImageSource GetNewMessagesNotificationOverlay(Window window, DataTemplate template, int count = 0)
		{
			if (window == null)
				return null;

			var presentation = PresentationSource.FromVisual(window);
			if (presentation == null)
				return null;
			Matrix m = presentation.CompositionTarget.TransformToDevice;
			double dx = m.M11;
			double dy = m.M22;

			double iconWidth = 16.0 * dx;
			double iconHeight = 16.0 * dy;

			string countText = count.ToString();

			RenderTargetBitmap bmp = new RenderTargetBitmap((int) iconWidth, (int) iconHeight, 96, 96, PixelFormats.Default);

			ContentControl root = new ContentControl
			{
				ContentTemplate = template,
				Content = count > 99 ? "…" : countText
			};

			root.Arrange(new Rect(0, 0, iconWidth, iconHeight));

			bmp.Render(root);

			return bmp;
		}
 protected abstract bool TryFindDataTemplate(
     ResourceDictionary resources, 
     FrameworkElement resourcesOwner,
     DependencyObject itemContainer,
     object item, 
     Type itemType,
     out DataTemplate dataTemplate);
        internal static FrameworkContentElement LoadDataTemplate(DataTemplate dataTemplate)
        {
            object content = dataTemplate.LoadContent();

            if (content is Fragment)
            {
                return (FrameworkContentElement)((Fragment)content).Content;
            }
            else if (content is TextBlock)
            {
                InlineCollection inlines = ((TextBlock)content).Inlines;

                if (inlines.Count == 1)
                {
                    return inlines.FirstInline;
                }
                else
                {
                    Paragraph paragraph = new Paragraph();

                    while (inlines.FirstInline != null)
                    {
                        paragraph.Inlines.Add(inlines.FirstInline);
                    }

                    return paragraph;
                }
            }
            else
            {
                throw new Exception("Data template needs to contain a <Fragment> or <TextBlock>");
            }
        }
Example #24
0
        public static FrameworkContentElement LoadDataTemplate(DataTemplate dataTemplate)
        {
            var content = dataTemplate.LoadContent();
            if (content is Fragment)
            {
                return ((Fragment)content).Content;
            }
            else if (content is TextBlock)
            {
                var inlines = ((TextBlock)content).Inlines;
                if (inlines.Count == 1)
                    return inlines.FirstInline;
                else
                {
                    var paragraph = new Paragraph();
                    // we can't use an enumerator, since adding an inline removes it from its collection
                    while (inlines.FirstInline != null)
                        paragraph.Inlines.Add(inlines.FirstInline);

                    return paragraph;
                }
            }
            else
            {
                throw new Exception("Data template needs to contain a <Fragment> or <TextBlock>");
            }
        }
 /// <summary>
 /// Override this method to return an app specific <seealso cref="DataTemplate"/>.
 /// </summary>
 /// <param name="item">The data content</param>
 /// <param name="container">The container in which the content is to be displayed</param>
 /// <returns>a app specific template to apply.</returns>
 public override DataTemplate SelectTemplate(object item, DependencyObject container)
 {
     if (SystemXmlHelper.IsXmlNode(item))
     {
         if (_xmlNodeContentTemplate == null)
         {
             _xmlNodeContentTemplate = new DataTemplate();
             FrameworkElementFactory text = ContentPresenter.CreateTextBlockFactory();
             Binding binding = new Binding();
             binding.XPath = _displayMemberPath;
             binding.StringFormat = _stringFormat;
             text.SetBinding(TextBlock.TextProperty, binding);
             _xmlNodeContentTemplate.VisualTree = text;
             _xmlNodeContentTemplate.Seal();
         }
         return _xmlNodeContentTemplate;
     }
     else
     {
         if (_clrNodeContentTemplate == null)
         {
             _clrNodeContentTemplate = new DataTemplate();
             FrameworkElementFactory text = ContentPresenter.CreateTextBlockFactory();
             Binding binding = new Binding();
             binding.Path = new PropertyPath(_displayMemberPath);
             binding.StringFormat = _stringFormat;
             text.SetBinding(TextBlock.TextProperty, binding);
             _clrNodeContentTemplate.VisualTree = text;
             _clrNodeContentTemplate.Seal();
         }
         return _clrNodeContentTemplate;
     }
 }
		void ChangeIsDeleted()
		{
			if (_deletationType == LogicalDeletationType.All)
			{
				if (!IsColumnShown)
				{
					var gridViewColumn = new GridViewColumn();
					gridViewColumn.Header = "Дата удаления";
					gridViewColumn.Width = 150;
					var dataTemplate = new DataTemplate();
					var txtElement = new FrameworkElementFactory(typeof(IsDeletedTextBlock));
					dataTemplate.VisualTree = txtElement;
					var binding = new Binding();
					var bindingPath = string.Format("RemovalDate");
					binding.Path = new PropertyPath(bindingPath);
					binding.Mode = BindingMode.OneWay;
					txtElement.SetBinding(IsDeletedTextBlock.TextProperty, binding);
					gridViewColumn.CellTemplate = dataTemplate;
					ListViewLayoutManager.SetCanUserResize(gridViewColumn, false);
					gridView.Columns.Add(gridViewColumn);
				}
			}
			else if (IsColumnShown)
			{
				gridView.Columns.Remove(IsDeletedColumn);
			}
		}
Example #27
0
        public ListBoxHandler()
        {
            Control = new swc.ListBox();
            Control.HorizontalAlignment = sw.HorizontalAlignment.Stretch;
            //Control.DisplayMemberPath = "Text";
            var template = new sw.DataTemplate(typeof(IListItem));

            template.VisualTree       = WpfListItemHelper.ItemTemplate(false);
            Control.ItemTemplate      = template;
            Control.SelectionChanged += delegate
            {
                Widget.OnSelectedIndexChanged(EventArgs.Empty);
            };
            Control.MouseDoubleClick += delegate
            {
                if (SelectedIndex >= 0)
                {
                    Widget.OnActivated(EventArgs.Empty);
                }
            };
            Control.KeyDown += (sender, e) =>
            {
                if (e.Key == sw.Input.Key.Return)
                {
                    if (SelectedIndex >= 0)
                    {
                        Widget.OnActivated(EventArgs.Empty);
                        e.Handled = true;
                    }
                }
            };
        }
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/LibraryManager;component/Views/SearchPage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.StorageListPickerFullItemTemplate        = ((System.Windows.DataTemplate)(this.FindName("StorageListPickerFullItemTemplate")));
     this.RoomListPickerFullItemTemplate           = ((System.Windows.DataTemplate)(this.FindName("RoomListPickerFullItemTemplate")));
     this.RackShelfLabelListPickerFullItemTemplate = ((System.Windows.DataTemplate)(this.FindName("RackShelfLabelListPickerFullItemTemplate")));
     this.createnew             = ((System.Windows.Controls.Button)(this.FindName("createnew")));
     this.filterpagebtn         = ((System.Windows.Controls.Button)(this.FindName("filterpagebtn")));
     this.historybtn            = ((System.Windows.Controls.Button)(this.FindName("historybtn")));
     this.applyfilterbtn        = ((System.Windows.Controls.Button)(this.FindName("applyfilterbtn")));
     this.fieldlbl              = ((System.Windows.Controls.TextBlock)(this.FindName("fieldlbl")));
     this.fieldlistpicker       = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("fieldlistpicker")));
     this.keytext               = ((System.Windows.Controls.TextBox)(this.FindName("keytext")));
     this.filterresultlist      = ((System.Windows.Controls.ListBox)(this.FindName("filterresultlist")));
     this.locationmainlist      = ((System.Windows.Controls.ListBox)(this.FindName("locationmainlist")));
     this.storagelbl            = ((System.Windows.Controls.TextBlock)(this.FindName("storagelbl")));
     this.storagelistpicker     = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("storagelistpicker")));
     this.roomlbl               = ((System.Windows.Controls.TextBlock)(this.FindName("roomlbl")));
     this.roomlistpicker        = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("roomlistpicker")));
     this.racklbl               = ((System.Windows.Controls.TextBlock)(this.FindName("racklbl")));
     this.racklistpicker        = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("racklistpicker")));
     this.shelflbl              = ((System.Windows.Controls.TextBlock)(this.FindName("shelflbl")));
     this.shelflistpicker       = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("shelflistpicker")));
     this.displaytypetext       = ((System.Windows.Controls.TextBlock)(this.FindName("displaytypetext")));
     this.displaytypelistpicker = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("displaytypelistpicker")));
     this.historylbl            = ((System.Windows.Controls.TextBlock)(this.FindName("historylbl")));
     this.historysearchlist     = ((System.Windows.Controls.ListBox)(this.FindName("historysearchlist")));
 }
Example #29
0
        private static DataTemplate CreateTemplate()
        {
            DataTemplate template = new DataTemplate {DataType = typeof(UiDataProviderNode)};

            FrameworkElementFactory stackPanel = new FrameworkElementFactory(typeof(StackPanel));
            stackPanel.SetValue(StackPanel.OrientationProperty, Orientation.Horizontal);

            FrameworkElementFactory image = new FrameworkElementFactory(typeof(Image));
            image.SetValue(HeightProperty, 16d);
            image.SetValue(Image.SourceProperty, new Binding("Icon"));
            image.SetValue(MarginProperty, new Thickness(3));
            stackPanel.AppendChild(image);

            //FrameworkElementFactory icon = new FrameworkElementFactory(typeof(ContentPresenter));
            //icon.SetValue(HeightProperty, 16d);
            //icon.SetValue(ContentPresenter.ContentProperty, new Binding("Icon"));
            //icon.SetValue(MarginProperty, new Thickness(3));
            //stackPanel.AppendChild(icon);

            FrameworkElementFactory textBlock = new FrameworkElementFactory(typeof(TextBlock));
            textBlock.SetBinding(TextBlock.TextProperty, new Binding("Title"));
            textBlock.SetBinding(ToolTipProperty, new Binding("Description"));
            textBlock.SetValue(MarginProperty, new Thickness(3));
            stackPanel.AppendChild(textBlock);

            template.VisualTree = stackPanel;

            return template;
        }
        private void GenerateContent(DataTemplate itemsPanel, DataTemplate itemTemplate, IEnumerable itemsSource) {
            Blocks.Clear();
            if (itemTemplate != null && itemsSource != null) {
                FrameworkContentElement panel = null;

                foreach (object data in itemsSource) {
                    if (panel == null) {
                        if (itemsPanel == null)
                            panel = this;
                        else {
                            FrameworkContentElement p = DocHelpers.LoadDataTemplate(itemsPanel);
                            if (!(p is Block))
                                throw new Exception("ItemsPanel must be a block element");
                            Blocks.Add((Block)p);
                            panel = Attached.GetItemsHost(p);
                            if (panel == null)
                                throw new Exception("ItemsHost not found. Did you forget to specify Attached.IsItemsHost?");
                        }
                    }
                    FrameworkContentElement element = DocHelpers.LoadDataTemplate(itemTemplate);
                    element.DataContext = data;
                    DocHelpers.UnFixupDataContext(element);
                    if (panel is Section)
                        ((Section)panel).Blocks.Add(DocHelpers.ConvertToBlock(data, element));
                    else if (panel is TableRowGroup)
                        ((TableRowGroup)panel).Rows.Add((TableRow)element);
                    else
                        throw new Exception(String.Format("Don't know how to add an instance of {0} to an instance of {1}", element.GetType(), panel.GetType()));
                }
            }
        }
    private static Func<DependencyObject, object, Type, object> FindTemplateResource; //null

    #endregion

    #region Constructors

    static GenericContentTemplateSelector()
    {
      // We need to initalize the ResourceDictionary before accessing since we access
      // it in a static constructor and will be called before the Layout was performed
      GenericContentTemplateSelector.GenericContentTemplateResources.InitializeComponent();

      GenericContentTemplateSelector.BoolTemplate = GenericContentTemplateSelector.GenericContentTemplateResources[ "booleanDefaultContentTemplate" ] as DataTemplate;
      Debug.Assert( GenericContentTemplateSelector.BoolTemplate != null );
      GenericContentTemplateSelector.BoolTemplate.Seal();

      GenericContentTemplateSelector.CommonTemplate = GenericContentTemplateSelector.GenericContentTemplateResources[ "commonDefaultContentTemplate" ] as DataTemplate;
      Debug.Assert( GenericContentTemplateSelector.CommonTemplate != null );
      GenericContentTemplateSelector.CommonTemplate.Seal();

      GenericContentTemplateSelector.ImageTemplate = GenericContentTemplateSelector.GenericContentTemplateResources[ "imageDefaultContentTemplate" ] as DataTemplate;
      Debug.Assert( GenericContentTemplateSelector.ImageTemplate != null );
      GenericContentTemplateSelector.ImageTemplate.Seal();

      GenericContentTemplateSelector.ForeignKeyCellContentTemplate = GenericContentTemplateSelector.GenericContentTemplateResources[ "foreignKeyDefaultContentTemplate" ] as DataTemplate;
      Debug.Assert( GenericContentTemplateSelector.ForeignKeyCellContentTemplate != null );
      GenericContentTemplateSelector.ForeignKeyCellContentTemplate.Seal();

      GenericContentTemplateSelector.ForeignKeyGroupValueTemplate = GenericContentTemplateSelector.GenericContentTemplateResources[ "foreignKeyGroupValueDefaultContentTemplate" ] as DataTemplate;
      Debug.Assert( GenericContentTemplateSelector.ForeignKeyGroupValueTemplate != null );
      GenericContentTemplateSelector.ForeignKeyGroupValueTemplate.Seal();

      GenericContentTemplateSelector.ForeignKeyScrollTipContentTemplate = GenericContentTemplateSelector.GenericContentTemplateResources[ "foreignKeyScrollTipDefaultContentTemplate" ] as DataTemplate;
      Debug.Assert( GenericContentTemplateSelector.ForeignKeyScrollTipContentTemplate != null );
      GenericContentTemplateSelector.ForeignKeyScrollTipContentTemplate.Seal();
    }
 public void SetDefaults()
 {
     BackgroundDefault = GetTemplate("ButtonTool.Background.Default");
     BackgroundOver = GetTemplate("ButtonTool.Background.Over");
     BackgroundDown = GetTemplate("ButtonTool.Background.Down");
     BackgroundTogglePressed = GetTemplate("ButtonTool.Background.TogglePressed");
 }
Example #33
0
		void UpdateAdditionalColumns()
		{
			GridView gridView = _treeList.View as GridView;
			EmployeesViewModel employeesViewModel = _treeList.DataContext as EmployeesViewModel;
			if (employeesViewModel.AdditionalColumnNames == null)
				return;

			var columnCount = 2;
			for (int i = gridView.Columns.Count - 1; i >= columnCount; i--)
			{
				gridView.Columns.RemoveAt(i);
			}

			for (int i = 0; i < employeesViewModel.AdditionalColumnNames.Count; i++)
			{
				var gridViewColumn = new GridViewColumn();
				gridViewColumn.Header = employeesViewModel.AdditionalColumnNames[i];
				gridViewColumn.Width = 350;

				var dataTemplate = new DataTemplate();
				var txtElement = new FrameworkElementFactory(typeof(TextBlock));
				dataTemplate.VisualTree = txtElement;
				var binding = new Binding();
				var bindingPath = string.Format("AdditionalColumnValues[{0}]", i);
				binding.Path = new PropertyPath(bindingPath);
				binding.Mode = BindingMode.OneWay;
				txtElement.SetBinding(TextBlock.TextProperty, binding);
				ListViewLayoutManager.SetStarWidth(gridViewColumn, 5);
				gridViewColumn.CellTemplate = dataTemplate;
				gridView.Columns.Add(gridViewColumn);
			}
		}
Example #34
0
		public EditableTextBlock()
		{
			var textBox = new FrameworkElementFactory(typeof(TextBox));
			textBox.SetValue(Control.PaddingProperty, new Thickness(1)); // 1px for border
			textBox.AddHandler(FrameworkElement.LoadedEvent, new RoutedEventHandler(TextBox_Loaded));
			textBox.AddHandler(UIElement.KeyDownEvent, new KeyEventHandler(TextBox_KeyDown));
			textBox.AddHandler(UIElement.LostFocusEvent, new RoutedEventHandler(TextBox_LostFocus));
			textBox.SetBinding(TextBox.TextProperty, new System.Windows.Data.Binding("Text") { Source = this, Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged });
			var editTemplate = new DataTemplate { VisualTree = textBox };

			var textBlock = new FrameworkElementFactory(typeof(TextBlock));
			textBlock.SetValue(FrameworkElement.MarginProperty, new Thickness(2));
			textBlock.AddHandler(UIElement.MouseDownEvent, new MouseButtonEventHandler(TextBlock_MouseDown));
			textBlock.SetBinding(TextBlock.TextProperty, new System.Windows.Data.Binding("Text") { Source = this });
			var viewTemplate = new DataTemplate { VisualTree = textBlock };

			var style = new System.Windows.Style(typeof(EditableTextBlock));
			var trigger = new Trigger { Property = IsInEditModeProperty, Value = true };
			trigger.Setters.Add(new Setter { Property = ContentTemplateProperty, Value = editTemplate });
			style.Triggers.Add(trigger);

			trigger = new Trigger { Property = IsInEditModeProperty, Value = false };
			trigger.Setters.Add(new Setter { Property = ContentTemplateProperty, Value = viewTemplate });
			style.Triggers.Add(trigger);
			Style = style;
		}
Example #35
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Chameleon;component/View/SettingImagePage.xaml", System.UriKind.Relative));
     this.PickerItemTemplate         = ((System.Windows.DataTemplate)(this.FindName("PickerItemTemplate")));
     this.PickerFullModeItemTemplate = ((System.Windows.DataTemplate)(this.FindName("PickerFullModeItemTemplate")));
     this.LayoutRoot                 = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ContentPanel               = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.LanguageMarketPicker       = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("LanguageMarketPicker")));
     this.BingSearchAspectPicker     = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("BingSearchAspectPicker")));
     this.BingSearchOptionsPicker    = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("BingSearchOptionsPicker")));
     this.BingSearchSizePicker       = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("BingSearchSizePicker")));
     this.BingSearchCustomSize       = ((System.Windows.Controls.Grid)(this.FindName("BingSearchCustomSize")));
     this.BingSearchSizeWidth        = ((System.Windows.Controls.TextBox)(this.FindName("BingSearchSizeWidth")));
     this.BingSearchSizeHeight       = ((System.Windows.Controls.TextBox)(this.FindName("BingSearchSizeHeight")));
     this.BingSearchColorPicker      = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("BingSearchColorPicker")));
     this.BingSearchStylePicker      = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("BingSearchStylePicker")));
     this.BingSearchFacePicker       = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("BingSearchFacePicker")));
     this.BingSearchQueryCountPicker = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("BingSearchQueryCountPicker")));
     this.BingSearchAdultPicker      = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("BingSearchAdultPicker")));
     this.DomainFilter               = ((System.Windows.Controls.TextBlock)(this.FindName("DomainFilter")));
 }
Example #36
0
        /// <summary>
        /// Gets the visual representation of the contents of this container. If it is 
        /// a single pushpin, the pushpin itself is returned. If multiple pushpins are present
        /// a pushpin with the given clusterTemplate is returned.
        /// </summary>
        public FrameworkElement GetElement(DataTemplate clusterTemplate)
        {
            if (_pushpins.Count == 1)
            {
                return _pushpins[0];
            }
            else
            {
                Pushpin retPin = new Pushpin()
                {
                    Location = _pushpins.First().Location,
                    Content = _pushpins.Select(pin => pin.DataContext).ToList(),
                    ContentTemplate = clusterTemplate,
                    Background = new SolidColorBrush((Color)Application.Current.Resources["PhoneAccentColor"])

                };

                retPin.MouseLeftButtonUp += new MouseButtonEventHandler(
                        (object sender, MouseButtonEventArgs e) =>
                        {
                            _map.Center = retPin.Location;
                            _map.ZoomLevel = _map.ZoomLevel + 3;
                        });
                return retPin;
            }
        }
Example #37
0
        /// <summary>
        /// Loads content in the specified template.
        /// </summary>
        /// <param name="template">Template to load.</param>
        /// <returns>Contents loaded from the specified template.</returns>
        public static DependencyObject LoadContent(DataTemplate template)
        {
            // This is a work around for a Beta1 Bug
            // Where under load the LoadContent can fail.
            // This stops us seeing this issue as frequently.
            // The idea is to try upto 5 times to load a template.
            // If it still does not load then rethrow the exception.
            int retryCount = 5;
            DependencyObject dependencyObject = null;
            if (template != null)
            {
                while (null == dependencyObject && 0 != retryCount)
                {
                    try
                    {
                        dependencyObject = template.LoadContent();
                    }
                    catch (System.Windows.Markup.XamlParseException e)
                    {
                        System.Diagnostics.Debug.WriteLine(e.ToString());
                        System.Diagnostics.Debug.WriteLine("\n Template Load Error");
                        retryCount--;
                        System.Threading.Thread.SpinWait(2000);
                        if (retryCount == 0)
                        {
                            throw;
                        }
                    }
                }
            }

            return dependencyObject;
        }
        private GridView GetGridView(List<dynamic> list)
        {
            GridView gridView = new GridView();

            int i = 0;
            foreach (dynamic item in list)
            {
                GridViewColumn col = new GridViewColumn();
                col.Header = item.Name;
                if (item.Type == "System.Boolean")
                {
                    System.Windows.DataTemplate template = new System.Windows.DataTemplate();
                    System.Windows.FrameworkElementFactory checkBox =
                        new System.Windows.FrameworkElementFactory(typeof(CheckBox));
                    checkBox.SetValue(CheckBox.VerticalAlignmentProperty, System.Windows.VerticalAlignment.Center);
                    Binding bd = new Binding("[" + i.ToString() + "].Value");
                    bd.Mode = BindingMode.OneTime;

                    checkBox.SetBinding(CheckBox.IsCheckedProperty, bd);
                    template.VisualTree = checkBox;
                    col.CellTemplate = template;
                }
                else
                {
                    col.DisplayMemberBinding = new System.Windows.Data.Binding("[" + i.ToString() + "].Value");
                }

                gridView.Columns.Add(col);
                i++;
            }

            return gridView;
        }
Example #39
0
        public ComboBoxHandler()
        {
            Control = new EtoComboBox();
            var template = new sw.DataTemplate(typeof(IListItem));

            template.VisualTree  = WpfListItemHelper.TextBlock(setMargin: false);
            Control.ItemTemplate = template;
        }
Example #40
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/gTask;component/Settings.xaml", System.UriKind.Relative));
     this.LayoutRoot           = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.SettingsPivot        = ((Microsoft.Phone.Controls.Pivot)(this.FindName("SettingsPivot")));
     this.TaskListSettings     = ((System.Windows.Controls.Grid)(this.FindName("TaskListSettings")));
     this.TaskListItemTemplate = ((System.Windows.DataTemplate)(this.FindName("TaskListItemTemplate")));
     this.TaskListScrollViewer = ((System.Windows.Controls.ScrollViewer)(this.FindName("TaskListScrollViewer")));
     this.ddlTaskListSort      = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("ddlTaskListSort")));
     this.ddlLiveTileCount     = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("ddlLiveTileCount")));
     this.chkIncludeNoDueDate  = ((System.Windows.Controls.CheckBox)(this.FindName("chkIncludeNoDueDate")));
     this.chkAutoRefreshList   = ((System.Windows.Controls.CheckBox)(this.FindName("chkAutoRefreshList")));
     this.TaskView             = ((System.Windows.Controls.Grid)(this.FindName("TaskView")));
     this.TaskViewItemTemplate = ((System.Windows.DataTemplate)(this.FindName("TaskViewItemTemplate")));
     this.TaskViewScrollViewer = ((System.Windows.Controls.ScrollViewer)(this.FindName("TaskViewScrollViewer")));
     this.ddlTaskSort          = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("ddlTaskSort")));
     this.chkNoDueDateAtTop    = ((System.Windows.Controls.CheckBox)(this.FindName("chkNoDueDateAtTop")));
     this.chkDisableDragDrop   = ((System.Windows.Controls.CheckBox)(this.FindName("chkDisableDragDrop")));
     this.chkHideNotes         = ((System.Windows.Controls.CheckBox)(this.FindName("chkHideNotes")));
     this.chkHideDueDate       = ((System.Windows.Controls.CheckBox)(this.FindName("chkHideDueDate")));
     this.chkAutoClear         = ((System.Windows.Controls.CheckBox)(this.FindName("chkAutoClear")));
     this.chkAutoRefreshTasks  = ((System.Windows.Controls.CheckBox)(this.FindName("chkAutoRefreshTasks")));
     this.TaskEdit             = ((System.Windows.Controls.Grid)(this.FindName("TaskEdit")));
     this.TaskEditItemTemplate = ((System.Windows.DataTemplate)(this.FindName("TaskEditItemTemplate")));
     this.TaskEditScrollViewer = ((System.Windows.Controls.ScrollViewer)(this.FindName("TaskEditScrollViewer")));
     this.ddlDefaultReminder   = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("ddlDefaultReminder")));
     this.chkTomorrowIf        = ((System.Windows.Controls.CheckBox)(this.FindName("chkTomorrowIf")));
     this.lstTime                  = ((Microsoft.Phone.Controls.TimePicker)(this.FindName("lstTime")));
     this.ddlTaskEditTextSize      = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("ddlTaskEditTextSize")));
     this.Notifications            = ((System.Windows.Controls.Grid)(this.FindName("Notifications")));
     this.NotificationItemTemplate = ((System.Windows.DataTemplate)(this.FindName("NotificationItemTemplate")));
     this.NotificationScrollViewer = ((System.Windows.Controls.ScrollViewer)(this.FindName("NotificationScrollViewer")));
     this.lblNotifications         = ((System.Windows.Controls.TextBlock)(this.FindName("lblNotifications")));
     this.chkCreateTaskList        = ((System.Windows.Controls.CheckBox)(this.FindName("chkCreateTaskList")));
     this.chkUpdateTaskList        = ((System.Windows.Controls.CheckBox)(this.FindName("chkUpdateTaskList")));
     this.chkCreateTask            = ((System.Windows.Controls.CheckBox)(this.FindName("chkCreateTask")));
     this.chkUpdateTask            = ((System.Windows.Controls.CheckBox)(this.FindName("chkUpdateTask")));
     this.chkSavedSettings         = ((System.Windows.Controls.CheckBox)(this.FindName("chkSavedSettings")));
     this.About       = ((System.Windows.Controls.Grid)(this.FindName("About")));
     this.lblVersion  = ((System.Windows.Controls.TextBlock)(this.FindName("lblVersion")));
     this.lblAppTitle = ((System.Windows.Controls.TextBlock)(this.FindName("lblAppTitle")));
     this.txtAbout    = ((System.Windows.Controls.TextBlock)(this.FindName("txtAbout")));
     this.btnBuy      = ((System.Windows.Controls.Button)(this.FindName("btnBuy")));
     this.Feedback    = ((System.Windows.Controls.Grid)(this.FindName("Feedback")));
     this.txtFeedback = ((System.Windows.Controls.TextBlock)(this.FindName("txtFeedback")));
     this.btnTweet    = ((System.Windows.Controls.Button)(this.FindName("btnTweet")));
     this.btnEmail    = ((System.Windows.Controls.Button)(this.FindName("btnEmail")));
     this.btnRate     = ((System.Windows.Controls.Button)(this.FindName("btnRate")));
 }
Example #41
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Bible_2;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot  = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.OldSelector = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("OldSelector")));
     this.old         = ((System.Windows.DataTemplate)(this.FindName("old")));
     this.NewSelector = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("NewSelector")));
 }
Example #42
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/CleverActivityTracker;component/Views/PivotPage1.xaml", System.UriKind.Relative));
     this.LayoutRoot             = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.MyCheckboxIndicate     = ((System.Windows.Controls.CheckBox)(this.FindName("MyCheckboxIndicate")));
     this.reorderListBox         = ((ReorderListBox.ReorderListBox)(this.FindName("reorderListBox")));
     this.reorderListBoxTemplate = ((System.Windows.DataTemplate)(this.FindName("reorderListBoxTemplate")));
 }
Example #43
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/GameManager;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot     = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.box_gameSearch = ((System.Windows.Controls.TextBox)(this.FindName("box_gameSearch")));
     this.btn_gameSearch = ((System.Windows.Controls.Button)(this.FindName("btn_gameSearch")));
     this.imageRef       = ((System.Windows.DataTemplate)(this.FindName("imageRef")));
 }
Example #44
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/PhoneApp1;component/Database.xaml", System.UriKind.Relative));
     this.ProdutosTemplate = ((System.Windows.DataTemplate)(this.FindName("ProdutosTemplate")));
     this.LayoutRoot       = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ContentPanel     = ((System.Windows.Controls.StackPanel)(this.FindName("ContentPanel")));
     this.lbProdutos       = ((System.Windows.Controls.ListBox)(this.FindName("lbProdutos")));
     this.txtProdutos      = ((Microsoft.Phone.Controls.PhoneTextBox)(this.FindName("txtProdutos")));
 }
Example #45
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/GameManager;component/MainPage.xaml", System.UriKind.Relative));
     this.ListTemplate = ((System.Windows.DataTemplate)(this.FindName("ListTemplate")));
     this.GridTemplate = ((System.Windows.DataTemplate)(this.FindName("GridTemplate")));
     this.LayoutRoot   = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.viewButton   = ((System.Windows.Controls.Image)(this.FindName("viewButton")));
     this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.Presenter    = ((System.Windows.Controls.ContentPresenter)(this.FindName("Presenter")));
 }
Example #46
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Rayzit;component/Pages/Settings.xaml", System.UriKind.Relative));
     this.LbOptionsItemTemplate = ((System.Windows.DataTemplate)(this.FindName("LbOptionsItemTemplate")));
     this.LayoutRoot            = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.RayzitSettingsPivot   = ((Microsoft.Phone.Controls.Pivot)(this.FindName("RayzitSettingsPivot")));
     this.DistanceMetricLP      = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("DistanceMetricLP")));
     this.DistanceLP            = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("DistanceLP")));
     this.LiveTileSwitch        = ((Microsoft.Phone.Controls.ToggleSwitch)(this.FindName("LiveTileSwitch")));
 }
Example #47
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Chameleon;component/View/SettingPage.xaml", System.UriKind.Relative));
     this.settingPage                            = ((Microsoft.Phone.Controls.PhoneApplicationPage)(this.FindName("settingPage")));
     this.PickerItemTemplate                     = ((System.Windows.DataTemplate)(this.FindName("PickerItemTemplate")));
     this.PickerFullModeItemTemplate             = ((System.Windows.DataTemplate)(this.FindName("PickerFullModeItemTemplate")));
     this.ColorPickerItemTemplate                = ((System.Windows.DataTemplate)(this.FindName("ColorPickerItemTemplate")));
     this.ColorPickerFullModeItemTemplate        = ((System.Windows.DataTemplate)(this.FindName("ColorPickerFullModeItemTemplate")));
     this.LsIBTemplatePickerItemTemplate         = ((System.Windows.DataTemplate)(this.FindName("LsIBTemplatePickerItemTemplate")));
     this.LsIBTemplatePickerFullModeItemTemplate = ((System.Windows.DataTemplate)(this.FindName("LsIBTemplatePickerFullModeItemTemplate")));
     this.IconPickerItemTemplate                 = ((System.Windows.DataTemplate)(this.FindName("IconPickerItemTemplate")));
     this.LayoutRoot                            = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.PivotSetting                          = ((Microsoft.Phone.Controls.Pivot)(this.FindName("PivotSetting")));
     this.PILivetileSetting                     = ((Microsoft.Phone.Controls.PivotItem)(this.FindName("PILivetileSetting")));
     this.UseRandomLivetileColor                = ((Microsoft.Phone.Controls.ToggleSwitch)(this.FindName("UseRandomLivetileColor")));
     this.LivetileWeatherColorPicker            = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("LivetileWeatherColorPicker")));
     this.LivetileCalendarColorPicker           = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("LivetileCalendarColorPicker")));
     this.LivetileBatteryColorPicker            = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("LivetileBatteryColorPicker")));
     this.LivetileFontWeightPicker              = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("LivetileFontWeightPicker")));
     this.LivetileWeatherFontSizePicker         = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("LivetileWeatherFontSizePicker")));
     this.LivetileBatteryFullPicker             = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("LivetileBatteryFullPicker")));
     this.UpdateIntervalLivetilePicker          = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("UpdateIntervalLivetilePicker")));
     this.PILockscreenSetting                   = ((Microsoft.Phone.Controls.PivotItem)(this.FindName("PILockscreenSetting")));
     this.LockscreenBackgroundTemplatePicker    = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("LockscreenBackgroundTemplatePicker")));
     this.LockscreenBackgroundColortPicker      = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("LockscreenBackgroundColortPicker")));
     this.LockscreenBackgroundOpacityHeader     = ((System.Windows.Controls.TextBlock)(this.FindName("LockscreenBackgroundOpacityHeader")));
     this.LockscreenBackgroundOpacity           = ((System.Windows.Controls.Slider)(this.FindName("LockscreenBackgroundOpacity")));
     this.UseLockscreenBackgroundItemSeparation = ((Microsoft.Phone.Controls.ToggleSwitch)(this.FindName("UseLockscreenBackgroundItemSeparation")));
     this.LockscreenFontWeightPicker            = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("LockscreenFontWeightPicker")));
     this.UpdateIntervalLockscreenPicker        = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("UpdateIntervalLockscreenPicker")));
     this.DomainFilter                          = ((System.Windows.Controls.TextBlock)(this.FindName("DomainFilter")));
     this.PIExtraSetting                        = ((Microsoft.Phone.Controls.PivotItem)(this.FindName("PIExtraSetting")));
     this.SVExtraSetting                        = ((System.Windows.Controls.ScrollViewer)(this.FindName("SVExtraSetting")));
     this.UseProtectiveColor                    = ((Microsoft.Phone.Controls.ToggleSwitch)(this.FindName("UseProtectiveColor")));
     this.SkinColorPicker                       = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("SkinColorPicker")));
     this.SPExSettingWeather                    = ((System.Windows.Controls.StackPanel)(this.FindName("SPExSettingWeather")));
     this.WeatherLocation                       = ((Microsoft.Phone.Controls.ToggleSwitch)(this.FindName("WeatherLocation")));
     this.WeatherUnitPicker                     = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("WeatherUnitPicker")));
     this.WeatherIconPackPicker                 = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("WeatherIconPackPicker")));
     this.SPExSettingCalendar                   = ((System.Windows.Controls.StackPanel)(this.FindName("SPExSettingCalendar")));
     this.CalendarFirstDayPicker                = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("CalendarFirstDayPicker")));
     this.CalednarDisplayAppointment            = ((Microsoft.Phone.Controls.ToggleSwitch)(this.FindName("CalednarDisplayAppointment")));
 }
        /// <summary>
        /// Creates a data-template that uses the given delegate to create new instances.
        /// </summary>
        public static DataTemplate CreateDataTemplate(Func <object> factory)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            var frameworkElementFactory = new FrameworkElementFactory(typeof(_TemplateGeneratorControl));

            frameworkElementFactory.SetValue(_TemplateGeneratorControl.FactoryProperty, factory);

            var dataTemplate = new System.Windows.DataTemplate(typeof(DependencyObject));

            dataTemplate.VisualTree = frameworkElementFactory;
            return(dataTemplate);
        }
Example #49
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/NoiseMap;component/UserControls/GoogleMap.xaml", System.UriKind.Relative));
     this.LogoTemplate  = ((System.Windows.DataTemplate)(this.FindName("LogoTemplate")));
     this.LayoutRoot    = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ContentPanel  = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.googlemap     = ((Microsoft.Phone.Controls.Maps.Map)(this.FindName("googlemap")));
     this.street        = ((Microsoft.Phone.Controls.Maps.MapTileLayer)(this.FindName("street")));
     this.ButtonZoomIn  = ((System.Windows.Controls.Button)(this.FindName("ButtonZoomIn")));
     this.ButtonZoomOut = ((System.Windows.Controls.Button)(this.FindName("ButtonZoomOut")));
 }
Example #50
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/PhoneApp1;component/teclado.xaml", System.UriKind.Relative));
     this.PickerItemTemplate         = ((System.Windows.DataTemplate)(this.FindName("PickerItemTemplate")));
     this.PickerFullModeItemTemplate = ((System.Windows.DataTemplate)(this.FindName("PickerFullModeItemTemplate")));
     this.LayoutRoot    = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ContentPanel  = ((System.Windows.Controls.StackPanel)(this.FindName("ContentPanel")));
     this.tiposTeclados = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("tiposTeclados")));
     this.txtTexto      = ((System.Windows.Controls.TextBox)(this.FindName("txtTexto")));
     this.txtTeste      = ((Microsoft.Phone.Controls.PhoneTextBox)(this.FindName("txtTeste")));
 }
Example #51
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/PhoneApp1;component/Listas.xaml", System.UriKind.Relative));
     this.CarrosItemTemplate = ((System.Windows.DataTemplate)(this.FindName("CarrosItemTemplate")));
     this.LayoutRoot         = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.pivot          = ((Microsoft.Phone.Controls.Pivot)(this.FindName("pivot")));
     this.lbSimples      = ((System.Windows.Controls.ListBox)(this.FindName("lbSimples")));
     this.lbCheck        = ((System.Windows.Controls.ListBox)(this.FindName("lbCheck")));
     this.appbarOk       = ((Microsoft.Phone.Shell.ApplicationBarIconButton)(this.FindName("appbarOk")));
     this.appbarCancelar = ((Microsoft.Phone.Shell.ApplicationBarIconButton)(this.FindName("appbarCancelar")));
 }
Example #52
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/GameManager;component/AddNewGameManually.xaml", System.UriKind.Relative));
     this.ListPickerItemTemplate = ((System.Windows.DataTemplate)(this.FindName("ListPickerItemTemplate")));
     this.LayoutRoot             = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ContentPanel           = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.gameCover    = ((System.Windows.Controls.Image)(this.FindName("gameCover")));
     this.gameTitle    = ((System.Windows.Controls.TextBox)(this.FindName("gameTitle")));
     this.gamePlatform = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("gamePlatform")));
     this.gameID       = ((System.Windows.Controls.TextBlock)(this.FindName("gameID")));
 }
Example #53
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/RankedSoloQueue;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot             = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ListPickerItemTemplate = ((System.Windows.DataTemplate)(this.FindName("ListPickerItemTemplate")));
     this.TitlePanel             = ((System.Windows.Controls.StackPanel)(this.FindName("TitlePanel")));
     this.ContentPanel           = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.summonerName           = ((Microsoft.Phone.Controls.PhoneTextBox)(this.FindName("summonerName")));
     this.listaRegiones          = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("listaRegiones")));
     this.Boton  = ((System.Windows.Controls.Button)(this.FindName("Boton")));
     this.existe = ((System.Windows.Controls.TextBlock)(this.FindName("existe")));
 }
Example #54
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/GovBids;component/Pages/FilterSetting.xaml", System.UriKind.Relative));
     this.LayoutRoot                 = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.PickerItemTemplate         = ((System.Windows.DataTemplate)(this.FindName("PickerItemTemplate")));
     this.PickerFullModeItemTemplate = ((System.Windows.DataTemplate)(this.FindName("PickerFullModeItemTemplate")));
     this.ContentPanel               = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.locationPicker             = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("locationPicker")));
     this.categoryPicker             = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("categoryPicker")));
     this.agencyPicker               = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("agencyPicker")));
     this.busyIndicator              = ((Telerik.Windows.Controls.RadBusyIndicator)(this.FindName("busyIndicator")));
 }
Example #55
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/DialedIn;component/View/GroupsView.xaml", System.UriKind.Relative));
     this.LayoutRoot       = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.TitlePanel       = ((System.Windows.Controls.StackPanel)(this.FindName("TitlePanel")));
     this.ApplicationTitle = ((System.Windows.Controls.TextBlock)(this.FindName("ApplicationTitle")));
     this.ContentPanel     = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.GroupsListBox    = ((System.Windows.Controls.ListBox)(this.FindName("GroupsListBox")));
     this.LBData           = ((System.Windows.DataTemplate)(this.FindName("LBData")));
     this.textBlock3       = ((System.Windows.Controls.TextBlock)(this.FindName("textBlock3")));
     this.appbar_button1   = ((Microsoft.Phone.Shell.ApplicationBarIconButton)(this.FindName("appbar_button1")));
 }
Example #56
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/LibraryManager;component/Views/AddUpdatePages/newlocation.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.StorageListPickerFullItemTemplate        = ((System.Windows.DataTemplate)(this.FindName("StorageListPickerFullItemTemplate")));
     this.RoomListPickerFullItemTemplate           = ((System.Windows.DataTemplate)(this.FindName("RoomListPickerFullItemTemplate")));
     this.RackShelfLabelListPickerFullItemTemplate = ((System.Windows.DataTemplate)(this.FindName("RackShelfLabelListPickerFullItemTemplate")));
     this.applybtn               = ((System.Windows.Controls.Button)(this.FindName("applybtn")));
     this.createnew              = ((System.Windows.Controls.Button)(this.FindName("createnew")));
     this.filterpagebtn          = ((System.Windows.Controls.Button)(this.FindName("filterpagebtn")));
     this.backbtn                = ((System.Windows.Controls.Button)(this.FindName("backbtn")));
     this.locationmainlbl        = ((System.Windows.Controls.TextBlock)(this.FindName("locationmainlbl")));
     this.locationviewstkpnl     = ((System.Windows.Controls.StackPanel)(this.FindName("locationviewstkpnl")));
     this.locationmainlist       = ((System.Windows.Controls.ListBox)(this.FindName("locationmainlist")));
     this.storagelbl             = ((System.Windows.Controls.TextBlock)(this.FindName("storagelbl")));
     this.storagelistpicker      = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("storagelistpicker")));
     this.roomlbl                = ((System.Windows.Controls.TextBlock)(this.FindName("roomlbl")));
     this.roomlistpicker         = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("roomlistpicker")));
     this.racklbl                = ((System.Windows.Controls.TextBlock)(this.FindName("racklbl")));
     this.racklistpicker         = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("racklistpicker")));
     this.shelflbl               = ((System.Windows.Controls.TextBlock)(this.FindName("shelflbl")));
     this.shelflistpicker        = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("shelflistpicker")));
     this.addstoragebtn          = ((System.Windows.Controls.Button)(this.FindName("addstoragebtn")));
     this.addroombtn             = ((System.Windows.Controls.Button)(this.FindName("addroombtn")));
     this.addrackbtn             = ((System.Windows.Controls.Button)(this.FindName("addrackbtn")));
     this.addshelfbtn            = ((System.Windows.Controls.Button)(this.FindName("addshelfbtn")));
     this.newstoragestkpnl       = ((System.Windows.Controls.StackPanel)(this.FindName("newstoragestkpnl")));
     this.newstoragefullnametext = ((System.Windows.Controls.TextBox)(this.FindName("newstoragefullnametext")));
     this.newstoragehomepagetext = ((System.Windows.Controls.TextBox)(this.FindName("newstoragehomepagetext")));
     this.newstorageemailtext    = ((System.Windows.Controls.TextBox)(this.FindName("newstorageemailtext")));
     this.newroomstkpnl          = ((System.Windows.Controls.StackPanel)(this.FindName("newroomstkpnl")));
     this.newroomfullnametext    = ((System.Windows.Controls.TextBox)(this.FindName("newroomfullnametext")));
     this.newroomemailtext       = ((System.Windows.Controls.TextBox)(this.FindName("newroomemailtext")));
     this.newrackstkpnl          = ((System.Windows.Controls.StackPanel)(this.FindName("newrackstkpnl")));
     this.newrackfullnametext    = ((System.Windows.Controls.TextBox)(this.FindName("newrackfullnametext")));
     this.newrackemailtext       = ((System.Windows.Controls.TextBox)(this.FindName("newrackemailtext")));
     this.newshelfstkpnl         = ((System.Windows.Controls.StackPanel)(this.FindName("newshelfstkpnl")));
     this.newshelffullnametext   = ((System.Windows.Controls.TextBox)(this.FindName("newshelffullnametext")));
     this.newshelfemailtext      = ((System.Windows.Controls.TextBox)(this.FindName("newshelfemailtext")));
 }
        private void GenerateByFrameworkElementFactory_Click(object sender, RoutedEventArgs e)
        {
            //FrameworkElementFactory
            //https://stackoverflow.com/questions/1754608/what-is-the-code-behind-for-datagridtemplatecolumn-and-how-to-use-it
            //https://stackoverflow.com/questions/45036667/create-a-grid-in-wpf-with-a-frameworkelementfactory

            DataGridTemplateColumn dataGridTemplateColumn = new DataGridTemplateColumn();

            dataGridTemplateColumn.Header = "操作";
            dataGridTemplateColumn.Width  = new DataGridLength(1, DataGridLengthUnitType.Star);
            //样式
            //dataGridTemplateColumn.CellStyle=new System.Windows.Style()
            //dataGridTemplateColumn.HeaderStyle=

            //Grid分列
            FrameworkElementFactory gridFactory = new FrameworkElementFactory(typeof(Grid));
            FrameworkElementFactory col1        = new FrameworkElementFactory(typeof(ColumnDefinition));
            FrameworkElementFactory col2        = new FrameworkElementFactory(typeof(ColumnDefinition));

            col1.SetValue(ColumnDefinition.WidthProperty, new GridLength(1, GridUnitType.Star));
            col2.SetValue(ColumnDefinition.WidthProperty, new GridLength(1, GridUnitType.Star));
            gridFactory.AppendChild(col1);
            gridFactory.AppendChild(col2);

            //添加两个Button
            FrameworkElementFactory btn1Factory = new FrameworkElementFactory(typeof(Button));

            btn1Factory.SetValue(Button.ContentProperty, "修改");
            //添加事件
            //https://stackoverflow.com/questions/47401286/how-to-pro-gramatically-add-click-event-to-frameworkelementfactory
            btn1Factory.AddHandler(Button.ClickEvent, new RoutedEventHandler(ModifyData_Click));
            FrameworkElementFactory btn2Factory = new FrameworkElementFactory(typeof(Button));

            btn2Factory.SetValue(Button.ContentProperty, "删除");
            btn2Factory.AddHandler(Button.ClickEvent, new RoutedEventHandler(DeleteData_Click));
            btn2Factory.SetValue(Grid.ColumnProperty, 1);

            gridFactory.AppendChild(btn1Factory);
            gridFactory.AppendChild(btn2Factory);
            //关键代码
            System.Windows.DataTemplate cellTemplate1 = new System.Windows.DataTemplate();
            cellTemplate1.VisualTree            = gridFactory;
            dataGridTemplateColumn.CellTemplate = cellTemplate1;
            dataGrid1.Columns.Add(dataGridTemplateColumn);
        }
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/ShareToAll;component/CheckIn.xaml", System.UriKind.Relative));
     this.LayoutRoot                 = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.PickerItemTemplate         = ((System.Windows.DataTemplate)(this.FindName("PickerItemTemplate")));
     this.PickerFullModeItemTemplate = ((System.Windows.DataTemplate)(this.FindName("PickerFullModeItemTemplate")));
     this.ContentPanel               = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.post_location              = ((Microsoft.Phone.Controls.ListPicker)(this.FindName("post_location")));
     this.place_text                 = ((System.Windows.Controls.TextBlock)(this.FindName("place_text")));
     this.progbar = ((System.Windows.Controls.ProgressBar)(this.FindName("progbar")));
     this.ok      = ((Microsoft.Phone.Shell.ApplicationBarIconButton)(this.FindName("ok")));
     this.cancel  = ((Microsoft.Phone.Shell.ApplicationBarIconButton)(this.FindName("cancel")));
 }
Example #59
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/DialedIn;component/View/TasksView.xaml", System.UriKind.Relative));
     this.LayoutRoot           = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.TasksPivotTitle      = ((Microsoft.Phone.Controls.Pivot)(this.FindName("TasksPivotTitle")));
     this.myGrid               = ((System.Windows.Controls.Grid)(this.FindName("myGrid")));
     this.MyTasksListBox       = ((System.Windows.Controls.ListBox)(this.FindName("MyTasksListBox")));
     this.LBData               = ((System.Windows.DataTemplate)(this.FindName("LBData")));
     this.AllTasksListBox      = ((System.Windows.Controls.ListBox)(this.FindName("AllTasksListBox")));
     this.NotificationsListBox = ((System.Windows.Controls.ListBox)(this.FindName("NotificationsListBox")));
     this.appbar_button1       = ((Microsoft.Phone.Shell.ApplicationBarIconButton)(this.FindName("appbar_button1")));
     this.Groups               = ((Microsoft.Phone.Shell.ApplicationBarMenuItem)(this.FindName("Groups")));
 }
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Logistics_system;component/controls/staticAnalyse.xaml", System.UriKind.Relative));
     this.OptionsPanelTemplate = ((System.Windows.DataTemplate)(this.FindName("OptionsPanelTemplate")));
     this.dialog       = ((EasySL.Controls.DialogPanel)(this.FindName("dialog")));
     this.LayoutRoot   = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.OptionsPanel = ((System.Windows.Controls.StackPanel)(this.FindName("OptionsPanel")));
     this.financialRb  = ((System.Windows.Controls.RadioButton)(this.FindName("financialRb")));
     this.prodectRb    = ((System.Windows.Controls.RadioButton)(this.FindName("prodectRb")));
     this.@static      = ((System.Windows.Controls.Button)(this.FindName("static")));
     this.grid         = ((DevExpress.AgDataGrid.AgDataGrid)(this.FindName("grid")));
     this.CurrencyToStringConverter = ((Logistics_system.CurrencyToStringConverter)(this.FindName("CurrencyToStringConverter")));
 }