binding

Convert string to model

旧街凉风 提交于 2019-12-20 07:39:48
问题 Let's say I have this object: public struct Line { public string Name { get; set; } public int Value { get; set; } public string Alias { get; set; } } And I have a file with lines following this syntax: garbagedata|moregarbagedata|Name|garbagedata3|Value|garbagedatamaximums|Alias\n Note that moregarbagedata[x] may or may not exist. A Regex is needed to extract the group-values. What is easiest and most efficient way to turn this file's lines into a collection of Line objects? Order of this

JAXB binding multiple files with same namespace to same package

喜你入骨 提交于 2019-12-20 07:22:00
问题 I'm having a schema hierarchy like this: common |---legacy | |---legacy.xsd xmlns="http://common/legacy" | |---other.xsd xmlns="http://common/legacy" | '---....xsd xmlns="http://common/legacy" |---send |---file.xsd xmlns="http://common/send" '---text.xsd xmlns="http://common/send" '---....xsd xmlns="http://common/send" All files in one folder have the same namespace. Now I want to map the namespaces to specific java packages (I cannot change the namespace). I found a solution to bind a schema

WPF Binding Combox with different List and different SelectedValue

落花浮王杯 提交于 2019-12-20 06:47:18
问题 In my UserControl ucStep2 I have DataContext of Step2InfoData object that has several properties along with : private string rockDensUnit; public string RockDensity_Unit { get { return rockDensUnit; } set { if (rockDensUnit != value) { rockDensUnit = value; Changed("RockDensity_Unit"); } } } In my app I got to bind several combo's with different normally measurement types Like {kg/m3, gm/m3}, {meter, cm} and so on such groups of measures. I mean, multiple combo's to have list of same items.

UWP StackedLineSeries doesn't show values

廉价感情. 提交于 2019-12-20 06:45:42
问题 I am trying to use WinRTXamlToolkit.Controls.DataVisualization.UWP trying to draw any of the stacked charts like this: But only this comes out: Please help me, I have to use stacked series but the framework doesn't act as it should be.. 回答1: Since I don't know how you define the code behind, I just provide the sample code as follows which can create a StackedLineSeries chart successfully. XAML Code <Page x:Class="CStackLineChat.MainPage" ... xmlns:charting="using:WinRTXamlToolkit.Controls

WPF TabControl and DataGrid bugs, bugs and bugs

无人久伴 提交于 2019-12-20 06:35:17
问题 for everyone, I found different problems with WPF, the TabControl and the DataGrid. Especially if the TabControl ItemsSource is bound. Problems i found: Selection in DataGrid is not visible after switch Tabs back and forth DataGrid looses sorting on tab switch (SortDescriptions of CollectionView.GetDefaultCollection is cleared on unload) if a DataGrid cell has focus (is in edit mode) and you click on another tab, two things can happen: 1.) the bound object will not be updated; 2.) if the

Is basicHttpBinding really required when exposing a WCF service as a Web Service for .NET 2.0 Target Client?

强颜欢笑 提交于 2019-12-20 06:21:42
问题 I have a WCF service and am hosting it in a Windows Service. I tried to add a reference for the service from a Windows Form client built on .NET 2.0. I could get the Web Reference by pointing to the httpGetUrl="http://localhost:8002/HBAccess/help/mex" but when I check the Reference.cs---It only contains a namespace with nothing in it. Now I add the basicHttpBinding and repeat the same steps: And now I can see the classes for the web service. My senior colleague insist that setting the

StringFormat of Datetime object in binding gives back 0 for hour and minute

北战南征 提交于 2019-12-20 06:12:27
问题 I create a Datetime object with Datetime.Now and I have this as a property of a class. When I bind this to a grid view: <GridViewColumn Header="Date" Width="120" DisplayMemberBinding="{Binding transaction_date1, StringFormat=HH:mm}" /> The result is always 00:00. When I debug the code I see that the hour, minute etc. properties of the Datetime object contain non-zero values. I think that the StringFormat in this case gets the hour and minute from the Date object within the Datetime object

Validation Rule for Radio buttons wpf

孤街浪徒 提交于 2019-12-20 05:22:06
问题 I have a RadioButton inside ItemsControl . By default Radio Buttons will be unchecked. I want the user to select either of the radio buttons if a particular value (string value) is configured in another screen. I need to apply a validation rule for the same. If the user does not select either of the radio buttons, then on click on a submit button, I should display validation error. XAML <StackPanel Grid.Row="1" Visibility="{Binding Path=IsUpdateSendDateConfigured}" Orientation="Horizontal"

Windows Phone Image Binding

扶醉桌前 提交于 2019-12-20 04:58:16
问题 I want to put images in my ListBox using Binding. Below is the object containing the URI's: _roomView.Room = new Room { Items = new List<Item> { new Item {ItemType = ItemType.BlueKey, ImageUri = "/Escape;component/Images/Items/a.jpg"}, new Item {ItemType = ItemType.Bracelet, ImageUri = "/Escape;component/Images/Items/b.png"}, new Item {ItemType = ItemType.Money, ImageUri = "/Escape;component/Images/Items/b.png"}} }; DataContext = _roomView; Below is the XML: <ListBox x:Name="Mylist"> <ListBox

Setting font of parent in nodes in WPF Tree View to Bold using code behind

一个人想着一个人 提交于 2019-12-20 04:52:51
问题 I have made a tree view and added parent and child nodes to it all using code behind, now where I am stuck is to set the font of parent nodes to BOLD while keeping the font of child as it is, below is code that i have right now. List<ParentTreeViewNode> ParentTreeViewNodeList = new List<ParentTreeViewNode>(); HierarchicalDataTemplate treeViewTemplate = new HierarchicalDataTemplate(typeof(Child)); treeViewTemplate.DataType = "{x:Type local:Child}"; treeViewTemplate.ItemsSource = new Binding(