xaml

XAML Tool Tip Data Context and Multi Binding

Hi there I have a ListView in my XAML and I am trying to hook up a MultiBinding Converter. <ListView Grid.Column="4" Grid.Row="1" Grid.RowSpan="5" Margin="8,0,8,8" HorizontalAlignment="Stretch" Name="lvDisplayType" ItemsSource="{Binding Path=Types}" SelectedItem="{Binding Path=Current.Opt}" VerticalAlignment="Stretch" ...

Is it possible to create a desktop application using Silverlight?

Hi! I have been using WPF for a while, and I keep on realizing again and again that Microsoft invests its efforst in Silverlight, not in WPF (RIA Services, default theme, controls and more). I thought it might be a good idea to migrate to Silverlight (i.e. creating standalone desktop apps with Silverlight 4.0), the question is whether ...

aliasing problem

hello, the code below draws two vertical lines on a canvas. these lines appear to be of different thickness on the screen although they are the same in code. i am tying to find a way to make them look as sharp as the border around the canvas. setting Path.SnapsToDevicePixels does not have any effect. The code is a contrived example, and...

Xaml converter in another project

Sorry for the F#... I have a VS project with the following class: namespace ABCCommonSilverlight module ConvertersAndFormatters = type FixedDecimalConverter () = interface IValueConverter with member this.Convert(value, targetType, parameter, culture) = if value = null then ...

WPF control with many GridViews

I have a WPF usercontrol that will dynamically have any number of gridviews. Each is essentially the exact same except for the ItemsSource. Therefore each have the same columns and the same RowDetailsTemplate. To be specific what I am actually doing is settings the columns to the bound values and then setting the RowDetailsTemplate to th...

Is there any way to set a binding on a TextBlock Span

I would like to use a several Span elements inside a TextBlock and have the content of the spans set by binding. I don't think this is possible, but wanted to double check here first. ...

Applying a background color to an entire Grid row in XAML Silverlight

I'm trying to apply a gradient background to just one row in a XAML Silverlight grid that I've created. I can do something like this without any trouble: <Grid> <Grid.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="Black" Offset="0" /> <GradientStop Color="W...

Silverlight datagrid header binding to constant

Say I have a bunch of local constants in my code behind that I want to use as headers, for example: const string TYPE_HEADER = "Type"; const string LOCATION_ HEADER = "Location"; etc. Is there any way I can bind the headers of my DataGridColumns to these like events are bound to local methods, for example: <data:DataGridTextColumn H...

Silverlight asp:silverlight tag

Hi, I am new to silverlight. Excuse me if this is simple question. I am trying to craete a sample application using Silverlight 4 in VS2010. The code that is generated by defualt in the aspx page is(apart from the script): <div id="silverlightControlHost"> <object data="data:application/x-silverlight-2," type="application/x-silver...

Coloring of ListBox

Is it possible to get this row coloring in the WPF Listbox? White LightGray Gray White LightGray etc.? Thanks ...

When are reference-type attached properties (DependencyProperty) released?

Say I want to make an attached property that attaches a list of object references to a view instance (a DependencyObject/FrameworkElement)... When does it release all of those references? Will it call Dispose on attached property values if they implement it? ...

Binding to external XML doesn't work, but adding XML using XData makes it work.

Here is the code for App.xaml: <!-- <XmlDataProvider x:Key="BookmarkData" Source="testData.xml" XPath="/Favourites"/>--> <XmlDataProvider x:Key="BookmarkData" XPath="/Favorites"> <x:XData> <Favorites> <Bookmark> <Title>Google</Title> <URL>http://www.google.com&lt;/URL&gt; ...

WPF - How to paint notebook-like lines as TextBox background?

A bit similar to this question. My aim is to evocate a notebook-like look of the textbox. OneNote does something similar, by setting background image of the editing surface. Of course it is not possible to align the lines in OneNote because the text can be freely formatted. I would like to do this with constant font (no formatting)...

In WPF, how can I cross-reference resources between ResourceDictionaries?

Hi. I work on a WPF project with many UserControls and I'm trying to put some sanity in my WPF resources. A base file contains generic stuff needed by all views, such as colors: <!-- Resources.xaml --> <Color x:Key="FlashOrange">#F59500</Color> Then, a resource file specific to a view needs to reference FlashOrange: <!-- ContactV...

Coding field navigation while creating paperless online versions of paper forms using WPF with C# and LinqToXml

Using WPF(with C# and LinqToXml), I am reproducing a paperless version of an existing paper form. The existing form includes some one-character-per-box text strings. I have already duplicated the appearance of the paper form using XAML. How can I add code to a one-character TextBox to automatically send control to the next TextBox onc...

In a WPF custom control, is it possible for a child element to Template bind to the event of the control?

I have a custom control that contains two elements that can be clicked (a button and a check box). I'd like to be able to put events in the XAML for each of these events. i.e. <Control OnButtonClick="SomeEvent" OnCheckBoxClick="SomeOtherEvent" /> I have no idea how to bind events like that. Any pointers? The following is the ...

WPF Forcing MouseDevice to be pressed

Hi! I have a windows form in a wpf window, and I'm trying to use DragMove when I click on the windows form, it's a picturebox so I want to be able to drag the window around just by clicking the picture. I catch my form's mouse down, and raise the wpf window's mouseleftbuttondown event with: if (e.Button == MouseButtons.Left) {...

Silverlight multiple views

Hello, Sorry for dummie question, I'm quite new in silverlight. I want to dinamically change the layout in my app: for example, I've got two radiobuttons: male and female, and I want to show additional controls depending on the gender selected. For example, if user checks male option, combobox1 should be shown, and if user checks anoth...

How to bind a ConvertorParameter

Hi all, I am trying to bind the value of a ConverterParameter. Currently finding it too tricky... Codebehind public static readonly DependencyProperty RecognitionProperty = DependencyProperty.Register("RecognitionToEdit", typeof(Recognition), typeof(RecognitionInstancesWindow), null); public Recognition Recognition { ...

Silverlight xaml TextBlock.Text with CDATA not showing up at runtime?

The following xaml causes the text "Activate a test to the left." to be visible at run-time and at design-time (in Vs2010): <TextBlock TextWrapping="Wrap"> <TextBlock.Text>Activate a test to the left.</TextBlock.Text> </TextBlock> The following shows nothing at run-time, but the text IS visible at design-time: <TextBlock TextWrap...