Questions tagged [xname]

26 questions
1
vote
2 answers

How to use enums as XName

I want to create a new XElement or XAttribute using an enum that stores the values. The constructor of both classes expects XName as name and object as content. This means that I can pass an enum as content but I need to use ToString() to use it in…
Alex Kamburov
  • 405
  • 4
  • 10
1
vote
0 answers

Adding GamerServicesComponent causes ridiculously long program start

Having finished the prototype for a game I'm working on, I moved on to integrate Networking and Netcode. The whole thing works fine aswell, my only problem is that upon adding the GamerServicesComponent to the Game, it takes forever to startup. It…
Eisenhorn
  • 1,702
  • 1
  • 13
  • 20
0
votes
0 answers

How to reference an Entry with defined x:Name="..." in ViewModel - "... does not exist in current context"

In a .NET MAUI Project, I have a View which contains an Entry with an EntryBehavior having a x:Name="myTextValidationBehavior" which I want to use in one of my ViewModels
OXO
  • 391
  • 1
  • 8
0
votes
2 answers

Is there a difference between el.Attribute ("...") and el.Attribute (XName.Get ("..."))?

In our production code, I've seen XML attributes being read using explicit XName.Get call: var name = element.Attribute (XName.Get ("name")); I used to always pass a string to Attribute: var name = element.Attribute ("name"); This is more readable…
Dan Abramov
  • 264,556
  • 84
  • 409
  • 511
0
votes
1 answer

How can I Access user control by identifier (Name,Uid...)?

I have a number (16 so far) of instances of user controls that I have built. Every one ot them have similar Properties. To each I gave a name: x:Name = "probeX" (where X is an int number). Each of these controls represent an electric probe. I want…
0
votes
1 answer

What is the easiest way to generate a Valid x:Name?

I am generating some Xaml based on some other source of input. In some cases I am generating x:Name values but they have invalid characters. I found this article on MSDN: XamlName Grammar Which describes the grammar of a x:Name tag but doesn't tell…
justin.m.chase
  • 13,061
  • 8
  • 52
  • 100
0
votes
1 answer

Two-way DataGrid binding with record structure (dynamic columns and rows)

I have a record structure that I am trying to bind to a DataGrid. Basically, my columns are dynamically specified by the view model. The value that should be displayed (and edited) in grid cell must be retrieved using a function on each record (the…
sohum
  • 3,207
  • 2
  • 39
  • 63
0
votes
1 answer

XNamespace + XName : The type 'XName' is not compatible with the type 'string'

I am learning F# and I trying to write a simple XML parser. In C#, I can easily use the + operator to combine a namespace and name, but not in F#. I am getting the following error on the last line of the code below: Error 1 Type constraint…
Martin
  • 39,309
  • 62
  • 192
  • 278
-1
votes
1 answer

How to set x:Name attribute when under scope of another element in WPF

I need to create several popups. All of them share the same structure : Top left section Top Right section Content section Therefore, I created a usercontrol to hold some content at 3 different places. I then exposed these "ContentControls" with…
Axel Samyn
  • 160
  • 1
  • 12
-1
votes
1 answer

cannot convert from 'System.Collections.Generic.List' to 'System.Xml.Linq.XName'

I am getting compiler error: 'System.Collections.Generic.List' to 'System.Xml.Linq.XName'. I was orgininally getting an 'XAttribute' does not contain a definition for 'Trim' and no accessible extension method 'Trim' ...etc.' but I think I figured it…
CoreyAl
  • 1
  • 1
-2
votes
1 answer

Getting reference error on naming controls - WPF

I have a solution named Solution1, which has multiple projects named Project1, Project2 etc. In Project1, I have a usercontrol called "DesignElement". When I name the UserControl from the XAML, using the "x:Name" and then compile it, i get the…
Sangeetha
  • 485
  • 2
  • 9
  • 24
1
2