Hello everybody, I am developing a small software in C# WPF for a consultancy which does chain system business. I have coded tree structure to show who referred whom. Now it has commission depending on level. If 1 referred 2 & 3 then 1 will get level-1 commission. If 2 referred 4, 5 & 3 referred 6, 7 then 1 will receive level-2 commissio...
Any one there you have used DoubleAnimationUsingKeyFrames in C# can he/she provide example code or link where I can find the solution. I know how to do in xaml but I want to do it in code using C#.
how can i convert following xaml to C#
<Storyboard x:Key="Storyboard1">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:...
I have two user controls arranged vertically in a grid, both of which can expand to be taller than the grid can accommodate. I've put them in each in a scrollviewer which functionally works. What I want though is to give them them space in proportion to the amount that they want at run time.
So if there's 500 height available, the upper...
I am trying to develop an application that uses a number of images that are stored in a seperate remote file location. The file-paths to the UI elements are stored within the Application Settings. Although I understand how to access and use the file-path from Settings in C# (Properties.Settings.Default.pathToGridImages + "OK.png"), I am...
I cannot get interception to work with Prism v2 (Oct 2009). I am trying to intercept the Setter for any Public Properties and then fire the PropertyChanged event if the property has changed. I can see that the code gets executed (by stepping through with the debugger or adding a debug point). However, the WPF Window controls that are bou...
Hello,
We have created a beautifully designed .NET WPF desktop application. We are installing the application with InnoSetup , and if .NET 3.5 is not present, it automatically installs it. However, the package to download .NET 3.5 is huge and we found out that about 30% of users do not finish instalation due to this.
The obvious soluti...
Particularly for 2d games, and particularly silverlight/wpf games.
If you think about it, you can divide a game object into its view (the graphic on the screen) and a view-model/model (the state, ai, and other data for the object). In silverlight, it seems common to make each object a user control, putting the model and view into a sing...
I need to create control to draw border around its child. So, I have created class and derived it from Decorator:
class RoundedBoxDecorator : Decorator
{
protected override Size ArrangeOverride(Size arrangeSize)
{
//some source
}
protected override void OnRender(DrawingContext dc)
{
//some source
...
I have a wpf app that needs to communicate(exchange data) with a custom designed device (we can modify the code for the device). Do I have any options to connect to the device if it is behind a firewall via http? I was hoping there would be a method where the admin would not have to forward any specific ports or do anything on his end. I...
In the example below:
I start program, type text, click button, see text above. Press ENTER see text again.
BUT:
I start program, type text, press ENTER, see no text.
It seems that the KeyDown event doesn't get access to the current value of the bound variable, as if it is always "one behind".
What do I have to change so that wh...
I have a WPF application where I'd like to create a custom pop-up that has modal behavior. I've been able to hack up a solution using an equivalent to 'DoEvents', but is there a better way to do this? Here is what I have currently:
private void ShowModalHost(FrameworkElement element)
{
//Create new modal host
v...
Hi,
I'm porting my application from Winforms+XNA to WPF (+ XNA?) and I would like to know if the combination WPF + XNA makes sense or not. If it brings some advantages or if it is rather a bad choice.
A few points about my game:
It's a desk game with simple 2D animations (movement)
Main window contains panels like available games/pla...
I use standard Cut, Copy and Paste commands (which is part of ApplicationCommands class). Is it possible to redefine CanExecute method?
Here is my code:
XAML:
<Window.CommandBindings>
<CommandBinding Command="Copy"
CanExecute="CopyCanExecute" Executed="CopyExecuted"/>
</Window.CommandBindings>
...
I am trying to develop an application that uses a number of images that are stored in a seperate remote file location. The file-paths to the UI elements are stored within the Application Settings. Although I understand how to access the images from Applications Settings using a MultiBinding and a value converter, I'm not sure how to inte...
In the below code, MousePressImage is a dependency property of class ButtonControl.
The following Binding doesn't work.. Appreciate your help in solving this issue..
Value="{Binding RelativeSource={x:Static RelativeSource.Self},
Path=MousePressImage}"/>
<Style TargetType="{x:Type local:ButtonControl}">
<Setter Prope...
I have a simple Button control that contains an Image object as its content. I want so set the Image opacity to 0.5 when the Button is disabled to provide an additional visual cue as to the Button status.
What is the simplest way to accomplish that result in XAML? Thanks for your help.
...
When I try to change image for WPF trigger 'IsMouseOver' for button, the control flickers a lot.. Is there any workaround for this issue?
...
The CollectionViewSource.GetDefaultView() method is not in Silverlight 3. In WPF I have this extension method:
public static void SetActiveViewModel<ViewModelType>(this ViewModelBase viewModel,
ViewModelType collectionItem,
ObservableCollection<ViewModelType> collection) where ViewModelType : ViewModelBase
{
Debug.Assert(col...
Hi
Why there is no HeaderedContentControl ItemsSource property?
How then can I databind to a list of objects to be represented by HeaderedContentControl?
Thanks
John
...
I'm using MVVM and am trying to databind the Source property of Image to my ViewModel in such a way that I can change the icon on the fly. What is the best pattern to follow for this? I still have the flexibility to change my ViewModel to suit, but I don't know where to start in either the xaml or ViewModel.
To be clear, I don't want my...