Hello All,
Suppose I have a loose xaml file with one resource in it, keyed "MyResource", and that I pull that loose xaml file into two other xaml files via ResourceDictionary.MergedDictionaries. Now suppose I put the following line of code in both of the code-behind files for the two xaml files:
object obj = FindResource("MyResource");...
What is the simplest way to get a WPF resource from code?
I need to disable a text box in a WPF form if a checkbox in the same window is checked. I have wired the checkbox to an event handler in code-behind. The event handler disables the checkbox and changes its background to a light gray, to indicate that the control is disabled:
pri...
I have a WPF application that loads different client data based on a setting in a random config file on the machine. I use the client ID read from this config file to load data from a different folder within the application. The data includes a Sql compact database, Images, Videos, etc. The content in the application will change based on...
I have a class having a Boolean member and I want to populate a Wpf ListBox with a collection of my class.
I want the background of the listboxitem to a different color if my boolean property is false. Is it possible with XAML ? What is the best way to do that ?
class Mi
{
public bool mybool{get;set;}
...
I have a 3rd party control (Visifire) which has a namespace that uses the "." format. This works fine in a WPF application, but not in a UserControl as it generates a "can't find assembly" if you try to include the namespace. This means I have to use code to add the control, set up the bindings, etc, etc, which is quite annoying as I wou...
I'm trying to hit-test a bunch of UserControls on a Canvas. I don't want the HitTest() to walk the whole way through the visual tree, so I'm using the FilterCallback to make sure I only hit-test the UserControl.
My problem is that the UserControl never hits, it should, but it doesn't. If I use the FilterCallback, I return that it hit ...
Hello All,
I am looking for About Window for WPF VS2008. Any Source code is available to download or one have to develop on his/her own.
Thanks you,
Harsha
...
Just wondered what that best approach is for this scenario - trying to databind to a collection which is being populated in another background thread.
My background thread is adding items to the collection in a processing loop which may run for several minutes. Every now and then it raises an event to the UI and passes a reference to t...
I want to set a label (or textbox) default string as long as the binding value is null. This works fine for any other property than content, for example:
<Label Content="{Binding Source={StaticResource pumpCurvesViewSource}, Path=/Label}">
<Label.ContentStringFormat>Details for pump curve: {0}</Label.ContentStringFor...
Hi,
I'm getting exception when I put below code in Visual Studio -2008 Code editor.Pls let me know how can I tackle this exception.And my visual studio is getting crashed on reload.
<Grid Background="WhiteSmoke" Height="262" Width="257">
<Grid.Effect>
<DropShadowEffect ShadowDepth="2"/>
</Grid.Effect>
</Grid>
Excepti...
I am trying to bind a combobox with the Tabitems using converter
My converter class is as follows
public class TabItemsCollection : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
ItemCollection collection = value as ItemCollection;
...
I have a TextBox in my WPF application which I've added a Paste event to using:
DataObject.AddPastingHandler(elm, new DataObjectPastingEventHandler(OnPaste));
Now I want to trigger the OnPaste event from C# code. How can I do this? I tried calling the Paste() function on the control. The text is pasted in the control, but the OnPaste...
I have task to give in my application possibility to open document that is located on server, but I dont know at all how to implement this.
Please give the main idea how can i do this?
...
Can anyone point me in the right direction for some documentation about handling WPF UI events in Powershell?
I want to know how to, for example, call a function when a CheckBox or Radio Button is changed.
Cheers!
Ben
...
Hi There,
I have a ClickOnce application that checks a server for a new version on startup.
I recently deployed a new version (2.0.0.0) whilst leaving the old version (1.9.9.9) on the server.
On startup version 2 will inform the user that a new version of available and download 1.9.9.9.
Is there a reason this could be happening? I ass...
Hi.
I'm trying to launch a WPF application from a Console application, using Application Domains,
but when I do, I receive unexpected errors.
Running the WPF application standalone, works.
This code works, too:
var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
var path = string.Format("{0}AddressbookDesktop.exe", baseDirecto...
Hi.
I want to execute a command in my viewmodel when the user presses enter in a TextBox.
The command works when bound to a button.
<Button Content="Add" Command="{Binding Path=AddCommand}" />
But I can't bring it to work from the TextBox.
I tried an Inputbinding, but it didn't work.
<TextBox.InputBindings>
<KeyBinding Command="{...
Got a bog standard button with a style that sets its margin. I followed a tutorial to add animation to it, but I want to move this into the style so I can apply the same animation to all my buttons.
I've tried a few ways but without any success, could anyone point me in the right direction?
<Button Name="btn7" Grid.Column="2" Grid.Row=...
Hi,
we have a rather odd requirement: The visibility of any control in our WPF-Application is to be driven by a database-table.
That means we have a table which stores the name of the element and its visiblity.
Now I am looking for an elegant way to implement this feature on the client side.
I could create my own UserControl and inh...
Hi.
I'm creating my first application using MVVM. I'd like to have a usercontrol that shows the results of some functions. Something like VS Error List.
I.E. if I choose some xml file in some other usercontrol and try to deserialize it, I'd like to have on this notification list some info like "Deserialization complete" or "Deserializ...