Hello, I am wanting to simply get the current XAML filename so I can make a decision in a user control. Any ideas on where this value lives in Silverlight 3?
For example:
if (currentPage == "home")
homeLink.foreground = "white"
elseif (cuurentPage == "settings")
settingsLink.foreground = "white"
...
I have a lot of XAML that is in a complete mess and it's usually due to one thing. GRID, Grid.Column and Grid.Row craziness!!
Now theres a few common ways you can make labelled lists in XAML:.
With a <Grid>
Advantages: Autosizing width of columns and rows
Disadvantages: No easy way to insert rows/columns either in VS or Blend [STILL!!...
I have a HyperlinkButton in a ListBox, the latter being bound to a list of items. I want the HyperLinkButton's Uri to be bound in this sort of fashion:
NavigateUri="/some/url.xaml?tag={Binding}"
Which obviously doesn't work, but you get the idea. Does anyone have a nice workaround for this? Preferably something compatible with WP7. Th...
I have thousands of quiz questions in a database which are in RTF format. The questions only change maybe once a month. At runtime, I need to choose a random subset of questions and display those questions in Flash/Flex. The formatting of the questions go beyond the capabilities of the RichText control or the HTML capabilities of a La...
There's quite a lot out there regarding binding a XAML StaticResource, such as a string constant to a XAML control. However I cannot find a good way to do two way binding in this scenario.
I want to bind a global boolean to a checkbox which enables 'debugging' mode, that toggles visibility of certain things throughout my application.
I...
Hello,
i've made a binding from a TextBox to a Property. If the user write a date-value into the TextBox, it should be automatically corrected. f.e.: 20.01.10 -> 20.01.2010
The correction is done in the propertys set-block:
public String DateOfBirth
{
get
{
if (patient.DateOfBirth != DateTime.MinValue)
...
I want to bind a control fill color to a boolean in c#, so if it is false, the color is Red and if it is true, the color is Green.
Pretty new to XAML, but want to get into good habits from the start.
Thanks,
Ben
...
I am trying to display an adress label. what i want is if AddresssLine2 is not an empty string (its never null) it should display it then a newline (I'm using VB, so its ), otherwise just display AddressLine2, which is an empty string, so in escense it is ignored. however, the StringFormat of the inner binding of AddressLine2 is complete...
I am designing a user control to display a note. So I have a NoteViewModel. In my designer I want to have a test note. So I have the following in my XAML:
<UserControl.Resources>
<local:NoteViewModel x:Key="ViewModel" d:IsDataSource="True">
<local:NoteViewModel.Note>
<localweb:Note
NoteID="1"
...
I have a rounded-corners button that I want to have a dynamically resizable width (static height) without changing the corner curvature. I'm trying a take on the sliding doors technique: an image for the left and right sides of the button, and a very long middle image. But I can't figure out how to make the middle image resize to only th...
I am trying to create a template for a content control such as Button or HeaderedContentControl etc. where the text is underlined.
I just want to underline the text when Content="This text is underlined" is specified.
It must continue to work as normal if Content is another UIElement.
Most posts asking this same question are satisfie...
I have the following piece of XAML code:
<controlsInputToolkit:ContextMenuService.ContextMenu>
<controlsInputToolkit:ContextMenu
Height="75"
Width="200"
IsOpen="False"
Visibi...
I have the following piece of XAML code:
<controlsInputToolkit:ContextMenuService.ContextMenu>
<controlsInputToolkit:ContextMenu
Height="75"
Width="200"
IsOpen="False"
Visibi...
Currently i have a user control which contains a listbox of other visual element user controls; which (for this special case) have been data templated.
<Grid>
<ListBox ItemSource="{Binding Path=UserControlCollection}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
...
Hi guys,
I am using an opensource wpf TreeListView control. The control is a library project with a themes folder in it containing some xaml theme files. In my wpf project, I have got a reference to the control dll and I would like to know how to reference the dll themes in app.xaml. I tried doing something like this but it throws excep...
I'm looking for (online) resources to learn/lookup XAML constructs.
Can you recommend any good blogs, tutorials, references for XAML?
...
Hello, I work in a team on a silverlight project. This silverlight project uses MVVM-light. When I want to build the project I get the following two errors:
Error 1 :
The type 'EventTrigger' does not support direct content.
I get this error on this xaml code:
<HyperlinkButton x:Name="HyperlinkButtonSelectAll" Content="Select all" IsTa...
I have a grid with two rows plus a grid splitter. I want the top row's height to be as small as possible by default (in this case, the height of the button) The bottom row should expand to take up the remaining space in the grid. I want the grid splitter there to allow the user to change the size as needed.
<Grid>
<Grid.RowDefinit...
I am trying to set twoway binding on a UserControl that I have created.
When I use the control in Xaml is set the DataContext like so...
<uc:MyUserControl DataContext="{Binding Path=MyObject, Mode=TwoWay}" />
My user control is defined as the following....
<UserControl x:Class="SilverlightApplication1.XText"
xmlns="http://schema...
I have a wrap panel full of rectangles, when you mouse over a rectangle it grows in size (using a storyboard animation) to simulate being magnified.
That all works fine, the problem is that if you mouse over the last rectangle in a row the magnification causes it to jump to the next line (because it grew too big to fit on the current l...