本文整理汇总了C#中System.Windows.Controls.Label.SetBinding方法的典型用法代码示例。如果您正苦于以下问题:C# Label.SetBinding方法的具体用法?C# Label.SetBinding怎么用?C# Label.SetBinding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Label
的用法示例。
在下文中一共展示了Label.SetBinding方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateColumnNameBox
public Label CreateColumnNameBox()
{
var columnNameBox = new Label();
columnNameBox.SetBinding(Label.ContentProperty, new Binding("ColumnName"){Source=_data});
return columnNameBox;
}
示例2: ScoringBoard
/// <summary>
/// 计分板,必须传入作为UI的Label
/// </summary>
/// <param name="Scoring_Board"></param>
public ScoringBoard(Label scoring_Board,int l1=100,int l2=250,int l3=400,int l4=600)
{
Binding binding = new Binding("Score");
binding.Source = this;
binding.Mode = BindingMode.OneWay;
binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
scoring_Board.SetBinding(Label.ContentProperty, binding);
L1 = l1; L2 = l2; L3 = l3; L4 = l4;
}
示例3: GetLabel
public Label GetLabel(UIElement visual)
{
var label = new Label();
var binding = new Binding();
binding.Source = visual;
binding.Path = new PropertyPath(LabelProperty);
label.SetBinding(ContentControl.ContentProperty, binding);
return label;
}
示例4: ViewModel
public ViewModel(int w, int h, MainViewModel mainModel)
{
this.mainModel = mainModel;
items = new ObservableCollection<GameObjectShape>();
Game = new Game(w, h);
Game.NewObject += (s, e) => AddToScene(e);
Game.RemoveObject += (s, e) => RemoveFromScene(e);
Game.GameEndEvent += (s, e) => GameEnded(e);
//informacios panel a jobb oldalon
//100*ch meret
HUDmodel sidepanelmodel = new HUDmodel(w - 100, 0, 100, h);
Rectangle sidepanel = new Rectangle();
sidepanel.Width = sidepanelmodel.Area.Width;
sidepanel.Height = sidepanelmodel.Area.Height;
sidepanel.Fill = sidepanelmodel.B;
items.Add(new GameObjectShape(sidepanelmodel, sidepanel));
//Palya label
Label palya = new Label();
HUDmodel palyaszammodel = new HUDmodel(w-100, 5, 0, 0);
palya.DataContext = game;
palya.ContentStringFormat = "Pálya: {0}";
palya.SetBinding(ContentControl.ContentProperty, new Binding("Palyaszam"));
items.Add(new GameObjectShape(palyaszammodel, palya));
//Eletek label
Label eletek = new Label();
HUDmodel eletmodel = new HUDmodel(w-100, 20, 0, 0);
eletek.DataContext = game;
eletek.ContentStringFormat = "Életek: {0}";
eletek.SetBinding(ContentControl.ContentProperty, new Binding("Player.Lives"));
items.Add(new GameObjectShape(eletmodel, eletek));
//Pontok label
Label pontszam = new Label();
HUDmodel pontmodel = new HUDmodel(w-100, 35, 0, 0);
pontszam.DataContext = game;
pontszam.ContentStringFormat = "Pontok: {0}";
pontszam.SetBinding(ContentControl.ContentProperty, new Binding("Player.Points"));
items.Add(new GameObjectShape(pontmodel, pontszam));
//jatekos fegyverenek sebzese
Label sebzes = new Label();
HUDmodel sebzesmodel = new HUDmodel(w - 100, 50, 0, 0);
sebzes.DataContext = game;
sebzes.ContentStringFormat = "Sebzés: {0}";
sebzes.SetBinding(ContentControl.ContentProperty, new Binding("Player.Damage"));
items.Add(new GameObjectShape(sebzesmodel, sebzes));
}
示例5: WhereAmI
public WhereAmI(IWpfTextView textView)
{
_textView = textView;
_monitor = new FileNameMonitor(GetDocument());
Height = 20;
ClipToBounds = true;
Background = new SolidColorBrush(Colors.DarkSlateGray);
var label = new Label
{
Background = new SolidColorBrush(Colors.DarkSlateGray),
Foreground = new SolidColorBrush(Colors.White),
};
label.SetBinding(ContentControl.ContentProperty, new Binding("FileName") { Source = _monitor });
Children.Add(label);
ToolTip = "Click to open in explorer";
}
示例6: UIWithHierarchicalPath
public UIWithHierarchicalPath()
{
var grid = new Grid();
Content = grid;
var label = new Label();
label.SetBinding(Label.ContentProperty, new Binding("Items/Description"));
grid.Children.Add(label);
var stack = new StackPanel();
stack.SetBinding(StackPanel.DataContextProperty, new Binding("Items"));
grid.Children.Add(stack);
label = new Label();
label.SetBinding(Label.ContentProperty, new Binding("/Description"));
stack.Children.Add(label);
var button = new Button();
button.SetBinding(Button.ContentProperty, new Binding("/"));
button.Template = CreateTemplate();
stack.Children.Add(button);
}
示例7: CreateAndBindDynamicProperties
private void CreateAndBindDynamicProperties(ControlSystemComponent controlSystemComponent, List<String> pidDocuments, List<String> specDocuments)
{
int rowCount = 5;
var controlSystemComponentProperies = controlSystemComponent.ControlSystemComponentType.ControlSystemComponentTypeProperties.ToList();
CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
cmsWebServiceClient.GetAllPropertyListsCompleted += (s, e) =>
{
List<ComponentTypeGroup> addedGroups = new List<ComponentTypeGroup>();
foreach (var controlSystemComponentProperty in controlSystemComponentProperies.OrderBy(x => x.Ordinal).ThenBy(x => x.GroupOrdinal))
{
//Skip Properties that are not visible
if (controlSystemComponentProperty.ControlSystemPropertyId.HasValue && !controlSystemComponentProperty.ControlSystemProperty.IsVisible) continue;
//Render Group
if (controlSystemComponentProperty.ComponentTypeGroupId.HasValue && !addedGroups.Contains(controlSystemComponentProperty.ComponentTypeGroup))
{
Label groupLabel = new Label
{
Content = controlSystemComponentProperty.ComponentTypeGroup.Name,
VerticalAlignment = VerticalAlignment.Center,
Margin = new Thickness(1),
FontWeight = FontWeights.Bold
};
PropertiesGrid.Children.Add(groupLabel);
Grid.SetRow(groupLabel, rowCount);
Grid.SetColumn(groupLabel, 0);
PropertiesGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(26) });
rowCount++;
addedGroups.Add(controlSystemComponentProperty.ComponentTypeGroup);
//This is a empty Group so don't need to render a Property
if (!controlSystemComponentProperty.ControlSystemPropertyId.HasValue) continue;
}
Label label = new Label();
Binding labelBinding = new Binding("Name")
{
Mode = BindingMode.OneTime,
Source = controlSystemComponentProperty.ControlSystemProperty
};
label.SetBinding(ContentControl.ContentProperty, labelBinding);
label.VerticalAlignment = VerticalAlignment.Center;
label.Margin = new Thickness(1);
PropertiesGrid.Children.Add(label);
Grid.SetRow(label, rowCount);
Grid.SetColumn(label, 0);
var propertyValue = GetPropertyValue(controlSystemComponent, controlSystemComponentProperty);
FrameworkElement element = Utils.BindElement(controlSystemComponentProperty.ControlSystemProperty, propertyValue,
e.Result, ComponentPropertyWrapViewModels, ControlChanged, pidDocuments, specDocuments);
PropertiesGrid.Children.Add(element);
Grid.SetRow((FrameworkElement)element, rowCount);
Grid.SetColumn((FrameworkElement)element, 1);
PropertiesGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(element.Height + 2) });
rowCount++;
}
LastInspectedTextBox.ResetOriginalValue();
LastInspectedTextBox.ControlChanged += ControlChanged;
NextInspectionTextBox.ResetOriginalValue();
NextInspectionTextBox.ControlChanged += ControlChanged;
};
cmsWebServiceClient.GetAllPropertyListsAsync();
}
示例8: InitializeGame
private void InitializeGame()
{
this.ClearControls();
// set game title
title.DataContext = game;
title.SetBinding(TextBlock.TextProperty, "VarietyName");
// fill in the players
matrix.RowDefinitions.RemoveRange(2, matrix.RowDefinitions.Count - 2);
foreach (Player player in game.Players) {
matrix.RowDefinitions.Add(new RowDefinition());
Label playerLabel = new Label() {
Style = (Style)Resources["PlayerName"],
};
playerLabel.DataContext = player;
playerLabel.SetBinding(Label.ContentProperty, new Binding("Name"));
playerLabel.SetValue(Grid.ColumnProperty, 0);
playerLabel.SetValue(Grid.RowProperty, matrix.RowDefinitions.Count - 1);
matrix.Children.Add(playerLabel);
}
// fill in the cards
matrix.ColumnDefinitions.RemoveRange(1, matrix.ColumnDefinitions.Count - 1);
var columnWidth = new GridLength(0.75 / game.Cards.Count(), GridUnitType.Star);
this.AddCardColumn(columnWidth, game.Suspects.OfType<Card>());
this.AddCardColumn(columnWidth, game.Weapons.OfType<Card>());
this.AddCardColumn(columnWidth, game.Places.OfType<Card>());
suspectsLabel.SetValue(Grid.ColumnSpanProperty, game.Suspects.Count());
weaponsLabel.SetValue(Grid.ColumnProperty, game.Suspects.Count());
weaponsLabel.SetValue(Grid.ColumnSpanProperty, game.Weapons.Count());
placesLabel.SetValue(Grid.ColumnProperty, game.Suspects.Count() + game.Weapons.Count());
placesLabel.SetValue(Grid.ColumnSpanProperty, game.Places.Count());
// fill in the envelope row
matrix.RowDefinitions.Add(new RowDefinition());
caseFile.SetValue(Grid.RowProperty, game.Players.Count + 2);
matrix.Children.Add(caseFile);
int cardIndex = 0;
foreach (Card c in game.Cards) {
Node node = game.Nodes.Where(n => n.CardHolder == game.CaseFile && n.Card == c).First();
Label nodeLabel = new Label();
nodeLabel.SetValue(Grid.ColumnProperty, 1 + cardIndex);
nodeLabel.SetValue(Grid.RowProperty, game.Players.Count + 2);
nodeLabel.DataContext = node;
nodeLabel.SetBinding(Label.ContentProperty, new Binding("IsSelected"));
matrix.Children.Add(nodeLabel);
cardIndex++;
}
}
示例9: AddCardColumn
private void AddCardColumn(GridLength columnWidth, IEnumerable<Card> cardGroup)
{
foreach (Card c in cardGroup) {
matrix.ColumnDefinitions.Add(new ColumnDefinition() { Width = columnWidth });
TextBlock cardBlock = new TextBlock() {
Style = (Style)Resources["VerticalText"]
};
cardBlock.DataContext = c;
cardBlock.SetBinding(TextBlock.TextProperty, new Binding("Name"));
cardBlock.SetValue(Grid.ColumnProperty, matrix.ColumnDefinitions.Count - 1);
cardBlock.SetValue(Grid.RowProperty, 1);
matrix.Children.Add(cardBlock);
// Fill in the individual nodes for this card.
foreach (Player player in game.Players) {
Node node = game.Nodes.Where(n => n.CardHolder == player && n.Card == c).First();
Label nodeLabel = new Label();
nodeLabel.SetValue(Grid.ColumnProperty, matrix.ColumnDefinitions.Count - 1);
nodeLabel.SetValue(Grid.RowProperty, game.Players.IndexOf(player) + 2);
nodeLabel.DataContext = node;
nodeLabel.SetBinding(Label.ContentProperty, new Binding("IsSelected"));
matrix.Children.Add(nodeLabel);
}
}
}
示例10: CreateLabel
/// <summary>
/// Creates a Label control for input type field
/// </summary>
/// <param name="parameterViewModel">DataContext object</param>
/// <param name="rowNumber">Row number</param>
/// <returns>Return a Label control</returns>
private Label CreateLabel(ParameterViewModel parameterViewModel, int rowNumber)
{
Label label = new Label();
label.SetBinding(Label.ContentProperty, new Binding("NameTextLabel"));
label.DataContext = parameterViewModel;
label.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
label.SetValue(Grid.ColumnProperty, 0);
label.SetValue(Grid.RowProperty, rowNumber);
label.Margin = new Thickness(2);
label.SetBinding(Label.ToolTipProperty, new Binding("ToolTip"));
//// Add AutomationProperties.AutomationId for Ui Automation test.
label.SetValue(
System.Windows.Automation.AutomationProperties.AutomationIdProperty,
string.Format(CultureInfo.CurrentCulture, "lbl{0}", parameterViewModel.Name));
return label;
}
示例11: PopulatePropertyValues
private void PopulatePropertyValues(ControlSystem controlSystem)
{
var rowCount = 1;
const int rowHeight = 25;
var typeTestingProperties = controlSystem.ControlSystemType.ControlSystemTypeTestingProperties;
var getAllPropertyListsTask = DatabaseLoader.GetAllPropertyLists();
var getPidDocumentsTask = DatabaseLoader.GetQuickDocuments(CommonUtils.DoctypePidCode);
var getSpecDocumentsTask = DatabaseLoader.GetQuickDocuments(CommonUtils.DoctypeFuncspecCode);
var tasks = new List<Task> { getAllPropertyListsTask, getPidDocumentsTask, getSpecDocumentsTask };
Task.Factory.ContinueWhenAll(tasks.ToArray(), xx =>
{
CMS.UiFactory.StartNew(() =>
{
var addedGroups = new List<ComponentTypeGroup>();
var propertyLists = getAllPropertyListsTask.Result;
mPidDocuments = getPidDocumentsTask.Result.Select(d => d.Name).ToList();
mSpecDocuments = getSpecDocumentsTask.Result.Select(d => d.Name).ToList();
List<ControlSystemTypeTestingProperty> list = typeTestingProperties.OrderBy(x => x.Ordinal).ThenBy(x => x.GroupOrdinal).ToList();
foreach (var typeTestingProperty in list)
{
//Skip Properties that are not visible
if (typeTestingProperty.TestPropertyId.HasValue && !typeTestingProperty.ControlSystemTestingProperty.IsVisible) continue;
#region Group
if (typeTestingProperty.ComponentTypeGroupId.HasValue && !addedGroups.Contains(typeTestingProperty.ComponentTypeGroup))
{
var groupLabel = new Label
{
Content = typeTestingProperty.ComponentTypeGroup.Name,
VerticalAlignment = VerticalAlignment.Center,
Margin = new Thickness(1),
FontWeight = FontWeights.Bold
};
PropertiesGrid.Children.Add(groupLabel);
Grid.SetRow(groupLabel, rowCount);
Grid.SetColumn(groupLabel, (int)GridColumn.Description);
PropertiesGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(26) });
rowCount++;
addedGroups.Add(typeTestingProperty.ComponentTypeGroup);
//This is a empty Group so don't need to render a Property
if (!typeTestingProperty.TestPropertyId.HasValue) continue;
}
#endregion
#region Property Value
var propertyValue = GetPropertyValue(controlSystem, typeTestingProperty);
var wrapViewModel = new ControlTestingPropertyWrapViewModel(typeTestingProperty.ControlSystemTestingProperty, propertyValue);
PropertyWrapViewModels.Add(wrapViewModel);
var element = BindElementValue(wrapViewModel, propertyLists, mPidDocuments, mSpecDocuments);
PropertiesGrid.Children.Add(element);
Grid.SetRow(element, rowCount);
Grid.SetColumn(element, (int)GridColumn.Value);
#endregion
#region Description
var descLabel = new Label();
var descLabelBinding = new Binding("ShortDescription")
{
Mode = BindingMode.OneTime,
Source = typeTestingProperty.ControlSystemTestingProperty
};
descLabel.SetBinding(ContentControl.ContentProperty, descLabelBinding);
descLabel.Margin = new Thickness(1);
PropertiesGrid.Children.Add(descLabel);
Grid.SetRow(descLabel, rowCount);
Grid.SetColumn(descLabel, (int)GridColumn.Description);
var toolTip = new ToolTip { Content = typeTestingProperty.ControlSystemTestingProperty.Description };
ToolTipService.SetToolTip(descLabel, toolTip);
#endregion
#region Notes
//NOTES
var binding = new Binding("Notes")
{
Mode = BindingMode.TwoWay,
Source = wrapViewModel,
UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
};
var notesTextBox = new CmsTextBox();
//.........这里部分代码省略.........
示例12: BindElementLabel
private UIElement BindElementLabel(TuningPropertyWrapViewModel tuningPropertyWrapViewModel, string bindingPath)
{
Binding binding = new Binding(bindingPath)
{
Mode = BindingMode.TwoWay,
Source = tuningPropertyWrapViewModel
};
Label lastModifiedLabel = new Label();
lastModifiedLabel.SetBinding(Label.ContentProperty, binding);
lastModifiedLabel.VerticalAlignment = VerticalAlignment.Center;
lastModifiedLabel.Margin = new Thickness(1);
UIElement returnElement = lastModifiedLabel;
return returnElement;
}
示例13: PopulatePropertyValues
private void PopulatePropertyValues(ControlSystemComponent controlSystemComponent)
{
int rowCount = 1;
const int rowHeight = 25;
//var controlSystemComponentProperies = controlSystemComponent.ControlSystemComponentType.ControlSystemComponentTypeProperties.OrderBy(x => x.Ordinal).ToList();
var controlSystemComponentTypeTuningProperties =
controlSystemComponent.ControlSystemComponentType.ControlSystemComponentTypeTuningProperties.OrderBy(x => x.Ordinal).ToList();
CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
cmsWebServiceClient.GetAllPropertyListsCompleted += (s, e) =>
{
List<ComponentTypeGroup> addedGroups = new List<ComponentTypeGroup>();
//controlSystemComponentProperies.Where(x => x.ComponentTypeGroupId.HasValue).ToList().ForEach(x => x.Ordinal = x.ComponentTypeGroup.Ordinal);
controlSystemComponentTypeTuningProperties = controlSystemComponentTypeTuningProperties.
OrderBy(x => x.Ordinal).ThenBy(x => x.GroupOrdinal).ToList();
foreach (var controlSystemComponentTypeTuningProperty in controlSystemComponentTypeTuningProperties.Where(x => x.ControlSystemTuningProperty.IsVisible))
{
if (controlSystemComponentTypeTuningProperty.ComponentTypeGroupId.HasValue && !addedGroups.Contains(controlSystemComponentTypeTuningProperty.ComponentTypeGroup))
{
Label groupLabel = new Label
{
Content = controlSystemComponentTypeTuningProperty.ComponentTypeGroup.Name,
VerticalAlignment = VerticalAlignment.Center,
Margin = new Thickness(1),
FontWeight = FontWeights.Bold
};
PropertiesGrid.Children.Add(groupLabel);
Grid.SetRow(groupLabel, rowCount);
Grid.SetColumn(groupLabel, 0);
PropertiesGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(26) });
rowCount++;
addedGroups.Add(controlSystemComponentTypeTuningProperty.ComponentTypeGroup);
}
//Property Label
Label label = new Label();
Binding labelBinding = new Binding("Name")
{
Mode = BindingMode.OneTime,
Source = controlSystemComponentTypeTuningProperty.ControlSystemTuningProperty
};
label.SetBinding(ContentControl.ContentProperty, labelBinding);
label.VerticalAlignment = VerticalAlignment.Center;
label.Margin = new Thickness(1);
Silverlight.Controls.ToolTips.ToolTip nameTip = new Silverlight.Controls.ToolTips.ToolTip
{
Content = controlSystemComponentTypeTuningProperty.ControlSystemTuningProperty.Description
};
ToolTipService.SetToolTip(label, nameTip);
PropertiesGrid.Children.Add(label);
Grid.SetRow(label, rowCount);
Grid.SetColumn(label, 0);
var propertyValue = GetPropertyValue(controlSystemComponent, controlSystemComponentTypeTuningProperty);
var tuningPropertyWrapViewModel = new TuningPropertyWrapViewModel(controlSystemComponentTypeTuningProperty.ControlSystemTuningProperty, propertyValue);
TuningPropertyWrapViewModels.Add(tuningPropertyWrapViewModel);
//Property VALUE
var element = BindElementValue(tuningPropertyWrapViewModel, e.Result);
PropertiesGrid.Children.Add(element);
Grid.SetRow((FrameworkElement) element, rowCount);
Grid.SetColumn((FrameworkElement) element, 1);
//PCS Value
var pcsValueElement = BindElementPcsvalue(tuningPropertyWrapViewModel, "PcsValue");
pcsValueElement.IsHitTestVisible = false;
//((CmsTextBox)pcsValueElement).Background = new SolidColorBrush(Color.FromArgb(255, 239, 239, 239));
PropertiesGrid.Children.Add(pcsValueElement);
Grid.SetRow((FrameworkElement) pcsValueElement, rowCount);
Grid.SetColumn((FrameworkElement) pcsValueElement, 2);
//Trended
var trendedElement = BindCheckBoxElement(tuningPropertyWrapViewModel, "Trended");
((FrameworkElement) trendedElement).HorizontalAlignment = HorizontalAlignment.Center;
PropertiesGrid.Children.Add(trendedElement);
Grid.SetRow((FrameworkElement) trendedElement, rowCount);
Grid.SetColumn((FrameworkElement) trendedElement, 3);
//Notes
var notesElement = BindElementTextBox(tuningPropertyWrapViewModel, "Notes");
PropertiesGrid.Children.Add(notesElement);
Grid.SetRow((FrameworkElement) notesElement, rowCount);
Grid.SetColumn((FrameworkElement) notesElement, 4);
//Accept
Button acceptButton = new Button {Content = "Accept"};
acceptButton.Height = 23;
acceptButton.DataContext = tuningPropertyWrapViewModel;
acceptButton.Command = tuningPropertyWrapViewModel.AcceptCommand;
//.........这里部分代码省略.........
示例14: CreateAndBindDynamicProperties
private void CreateAndBindDynamicProperties(InstrumentComponent instrumentComponent, List<String> pidDocuments, List<String> specDocuments)
{
int rowCount = 5;
var controlSystemComponentProperies = instrumentComponent.InstrumentComponentType.InstrumentComponentTypeProperties.OrderBy(x => x.Ordinal).ToList();
CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
cmsWebServiceClient.GetAllPropertyListsCompleted += (s, e) =>
{
foreach (var controlSystemComponentProperty in controlSystemComponentProperies.Where(x => x.InstrumentProperty.IsVisible))
{
Label label = new Label();
Binding labelBinding = new Binding("Name")
{
Mode = BindingMode.OneTime,
Source = controlSystemComponentProperty.InstrumentProperty
};
label.SetBinding(ContentControl.ContentProperty, labelBinding);
label.VerticalAlignment = VerticalAlignment.Center;
label.Margin = new Thickness(1);
PropertiesGrid.Children.Add(label);
Grid.SetRow(label, rowCount);
Grid.SetColumn(label, 0);
var propertyValue = GetPropertyValue(instrumentComponent, controlSystemComponentProperty);
var element = Utils.BindElement(controlSystemComponentProperty.InstrumentProperty, propertyValue, e.Result,
ComponentPropertyWrapViewModels, ControlChanged, pidDocuments, specDocuments);
PropertiesGrid.Children.Add(element);
Grid.SetRow((FrameworkElement)element, rowCount);
Grid.SetColumn((FrameworkElement)element, 1);
PropertiesGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(element.Height + 2) });
rowCount++;
}
LastInspectedTextBox.ResetOriginalValue();
LastInspectedTextBox.ControlChanged += ControlChanged;
NextInspectionTextBox.ResetOriginalValue();
NextInspectionTextBox.ControlChanged += ControlChanged;
};
cmsWebServiceClient.GetAllPropertyListsAsync();
}
示例15: MORSObjectsMerge
//.........这里部分代码省略.........
ColumnDefinition col = new ColumnDefinition();
col.MinWidth = 300;
mGrid.ColumnDefinitions.Add(col);
lbl = new Label();
lbl.Content = "pozycja";
lbl.Style = stylCala;
Grid.SetColumn(lbl, 0);
Grid.SetRow(lbl, 0);
mGrid.Children.Add(lbl);
//generuje nazwy pozycji i nazwy grup
mGrid.RowDefinitions.Add(new RowDefinition());
int index = 1;
foreach (string str in listaGrup)
{
mGrid.RowDefinitions.Add(new RowDefinition());
lbl = new Label();
lbl.Content = str;
lbl.Style = stylNazwaGrupy;
lbl.MouseDown += new MouseButtonEventHandler(OnGroupNameClick);
Grid.SetColumn(lbl, 0);
Grid.SetRow(lbl, index);
listaWierszy.Insert(index++ - 1, new cPDBVar(0, "none", "none", str));
mGrid.Children.Add(lbl);
foreach (cPDBVar wiersz in listaWierszy)
{
if (wiersz.VarGroup == str && wiersz.Name != "none")
{
mGrid.RowDefinitions.Add(new RowDefinition());
lbl = new Label { DataContext = wiersz };
lbl.SetBinding(Label.ContentProperty, new Binding("Name"));
lbl.Style = stylNazwaPoz;
lbl.MouseDown += new MouseButtonEventHandler(OnRowNameClick);
Grid.SetColumn(lbl, 0);
Grid.SetRow(lbl, index++);
mGrid.Children.Add(lbl);
}
}
}
//generuje nazwy kolumn
for (int i = 0; i < listacPDB.Count(); ++i)
{
mGrid.ColumnDefinitions.Add(new ColumnDefinition());
lbl = new Label { DataContext = listacPDB[i] };
lbl.SetBinding(Label.ContentProperty, new Binding("IdPDB"));
lbl.Style = stylNazwaPrel;
lbl.MouseDown += new MouseButtonEventHandler(OnColumnNameClick);
Grid.SetColumn(lbl, i + 1);
Grid.SetRow(lbl, 0);
mGrid.Children.Add(lbl);
}
//generuje ostatnia kolumne
mGrid.ColumnDefinitions.Add(new ColumnDefinition());
lbl = new Label();
lbl.ContentStringFormat = "C";
lbl.Content = "suma";
lbl.Style = stylNazwaPrel;
Grid.SetColumn(lbl, mGrid.ColumnDefinitions.Count());