Hey everyone,
I'm using MVVM and each View maps to a ViewModel with a convention. IE
MyApp.Views.MainWindowView
MyApp.ViewModels.MainWindowViewModel
Is there a way to remove the DataTemplate and do it in C#? with some sort of loop?
<DataTemplate DataType="{x:Type vm:MainWindowViewModel}">
<vw:MainWindowView />
</DataTemplate>
...
Someone suggested this for me to use as an animation:
<Window x:Class="WpfApplication.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="600" Width="600">
<Window.Resources>
<Storyboard x:Key="ScaleImageStoryboard">
<Double...
I need them to be ordered neatly and be able to use animations on each image.
The animation will be a simple "grow" effect to symbolize that the image has been selected. So when a user clicks the image, that Image will grow a bit.
So, a grid? A stack? I'm a bit confused.
...
The following snippet:
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<StackPanel Orientation="Horizontal"
VerticalAlignment="Center"
HorizontalAlignment="Center"> ...
Hi,
In a style, how can I refer to the element on which the style is applied ? For instance, in the style I define a RenderTransform, and I would like to add an animation on the RenderTransform :
<Style x:Key="myStyle" TargetType="{x:Type FrameworkElement}">
<Setter Property="RenderTransform">
<Setter.Value>
...
I am very new to WPF and I am a bit stuck. I'm trying to create a demo program that displays several embedded win forms applications. I'd like to add a reflection of the form, but most of the existing tutorials I've seen seen for image reflections do not work. If anyone can point me in the right direction I would really appreciate it.
H...
Hi folks
I have recently joined a new developing project building a thick client application using WPF and MVVM. I have developed applications in various .NET frameworks from 1.1 through to 3.5 and all major technologies; WebForms, MVC and WinForms. On all of my projects I have enjoyed every minute of it but on this project I feel that ...
How can I make a program that checks for updates on this site or facebook, etc.
...
In code behind file of the main window of WPF application I have a method quering a database with LINQ to SQL and writing results to an ObservableCollection:
public void GetStateByDate(string shcode)
{
MydbDataContext contextSts = new MydbDataContext();
_ShAvaQuCollection.Clear();
var sts = from p in co...
I'm developing an Outlook Add-in in WPF. Outlook Add-in is an UserControl. My simplified XAML code look's :
<UserControl>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="150"/>
<RowDefinition Height="*"/>
<RowDefinition Height="20"/>
</Grid.RowDefinition...
I'm trying to bind datagrid to xml:
<StackPanel.DataContext>
<XmlDataProvider Source="bill.xml" XPath="/Foods/Food"/>
</StackPanel.DataContext>
<DataGrid Width="190" Height="200" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="Black" ItemsSource="{Binding}">
<DataGrid.Columns>
<DataGridTextColumn Header="Quantity" Fon...
I made an application which draws a tree of organization based on values from an xml file.
The xaml file goes like this :
<Window.Resources>
<!-- The Org Chart Data-->
<XmlDataProvider x:Key="organization" Source="model.xml" />
<SolidColorBrush x:Key="ListBorder" Color="#FF7F9DB9"/>
<!-- The Style for Nodes -->
...
When trying to use the following
EventManager.RegisterClassHandler(typeof(TextBox),
TextBox.GotFocusEvent,
new RoutedEventHandler(TextBox_GotFocus));
I am getting an error on 2nd parameter:
"'System.Windows.Controls.TextBox' does not contain a definition for 'GotFocusEvent'"
Any help how to resolve this?
I am in the process of addi...
In Windows Forms Applications Im using the following Code to scroll the Page inside a Webbrowser:
HtmlDocument doc = webBrowser.Document;
mshtml.IHTMLDocument2 htmldoc = (mshtml.IHTMLDocument2)doc.DomDocument;
htmldoc.parentWindow.scrollBy(265, 20);
Does anyone know how to do the same in an WPF Application (without using WindowsFor...
I have an application that uses Linq-to-SQL and stores very large objects. When it's processing and saving these new objects, I want to keep them in memory, but after it saves I want to get rid of the lazy loaded property (the one that is taking up all the memory).
Is there any way to do this without just getting rid of the object and r...
So, here is my issue, im working in a Wpf application, so i dont have all of the standard windows form controls.. so im attempting to use a windowsformshost, to hold a webbrowser inside of a tabitem. So here is what i have:
Tab t = new Tab();
Browser newbrowse = new Browser(t);
WindowsFormsHost host = new Windows...
I have some WinForms controls that I need to use in a WPF window. I'm able to get the controls to show up just fine and everything works as I would expect, but I'm experiencing one issue: all the WinForms controls are unstyled.
I'd like for the WinForms controls to at least use the default OS style (like I would see in a WinForms applic...
How can I refer to active Window of WPF application in C#, using something like ActiveForm property in WinForms?
...
I have a related question here where i have a user control with a command binding. The user control has being removed from the visual tree, yet the canExecute is still firing. My understanding of the Commanding model was that it bubbles and tunnels like routed events. So how can the CanExecute fire once the element with the command bindi...
In my XAML I declare an instance of a class called DataConnection, the instance is named MyConnection.
<Window.Resources>
<!-- Create an instance of the DataConnection class called MyConnection -->
<!-- The TimeTracker bit comes from the xmlns above -->
<TimeTracker:DataConnection x:Key="MyConnection" />
...