wpf

How to make the animation smoother through code in WPF?

Hi, How do we do the smooth animation. I have the code as below. ThicknessAnimation anima = new ThicknessAnimation(new Thickness(0), new Thickness(0, 25, 0, 0), new Duration(new TimeSpan(0, 0, seconds)), FillBehavior.HoldEnd); pdRod.BeginAnimation(Border.MarginProperty, anima); Its working, but not smo...

unhandled exception Handler in .Net 3.5 SP1

Hi. I'm converting my own web browser use WPF from Windows XP to Windows 7. when I test on Windows XP, It has no error and exceptions. But I convert and test on Windows 7 with Multi-touch Library, My Browser occurred unhandled exception. Source: PresentationCore Message: An unspecified error occurred on the render thread. StackTrace: ...

Refer a dll which is inside another dll in WPF

How to refer a dll which is inside another dll in WPF? For example if I have two dlls A.dll and B.dll. A.dll contains a reference to B.dll and I build A.dll. Now I want to get a component in B.dll from A.dll I use as /A;component/B;component/Original.xaml" But it is not working? ...

Redirection Between View In MVVM

I am using MVVM patern for developing my WPF application. It working fine for unrelated pages, means how to go in another view from one view. Eg: I have one list page in which some records are coming from one ViewModel and another from another ViewModel, means I have two ViewModel form my single View. And now I want to display another ...

WPF binding Dictionary<string, List<string> to listView, ListBox how?

how to bind Dictionary to ListView and Text box? namespace Models { public class DynamicList { #region Constructor public DynamicList() { _propDict = new Dictionary<string, object>(); dynimicListProps = new List<DynimicListProperty>(); } #endregion Constructor #region Fields private Dic...

[WPF]Databinding stackpanel

Hi Im a beginner in WPF programming, coming from .NET 2.0 C#. Im trying to make a horisontal stackpanel which should be filled with data from a table in a database. The problem is that i want it to display an image with some text from the table below and then stack those two items horisontally. Here's some pseudo-code to display what ...

TreeView.ItemContainerGenerator.ContainerFromItem returns null for nonroot items. Workaround?

In the following sample, when I select "String", the title of the window turns to "null". But I must obtain the container of "String". Specifically, I want to do the equivalent of SelectedItem = null (but that property is read only for TreeView, so I'm trying to get to the container to set its IsSelected to false). What to do? <Window x...

Coule not add checkbox in datatable at runtime C# wpf

private void SetAppData() { ArrayList alDiscoveredNodes = this.DiscoverNetworNodes(); //initializeViewDataTable will add colums to ViewDataTable that will be shown on View initializeViewDataTable(alDiscoveredNodes); Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPr...

Good resources for learning WPF

I am very new to WPF and I am interested in learning it. I have gone through some tutorials, but I am looking for a website or book containing projects/assignments along with solutions so that you can code and learn. As I work through a project, I'd like to be able to refer to a solution in case I get stuck somewhere. Can someone please...

What do you use to create and print forms/documents?

I am not looking to print the screen capture of the UI but a regular form like something you might fill out at the dmv. What do you use to create these forms/documents how do you merge the data into them and print/print preview? ...

Access TextBlock binding path programatically

This is a follow-up question to my previous one about replacing GridView contents programmatically. I have a GridView displaying a DataSet. All of my columns are bound in my xaml with DisplayMemberBinding: <GridViewColumn DisplayMemberBinding="{Binding Path=FirstName}" Header="First Name" ...

WPF - Filtering/Searching multiple collection views within a treeview

I have a treeview that is bound to a collection and each item in the collection is bound to another collection. (using hierachle data templates) I would like to use the collection view .Filter event handler to search the tree. The problem is that I need multiple collection views. What would be the best way to filter the tree view items...

Does using dispatcher.Invoke make my thread safe?

In my WPF app I have a long running upload running, which raises progress events as it goes which updates a progress bar. The user also has a chance of cancelling the upload, or it might go wrong. These are all async events, so they need to be executed using Dispatcher.Invoke in order to update the UI. So the code looks like this, ish: ...

WPF DataGrid - Problem Customizing a ComboBox.

I have a Datagrid with a combo box bound column that works great as follows: <tk:DataGridComboBoxColumn SelectedValueBinding="{Binding DefaultLocationID}" SelectedValuePath="LocationID" DisplayMemberPath="LocationName" Header="Default Location" ItemsSource="{Binding Source=...

Can I have a Treeview without the tree structure?

Hi all, Can someone tell me how I can template a treeview control so that it doesn't look like a tree? Basically, I want to remove the indents at various levels as well as the +/- that allow for expansion and collapse. The actual requirement is that I have a hierarchical data template that is bound to an object collection that is rec...

Deploying xbap in a full trust mode

I have xbap which needs to run on a full trust mode because my application needs to upload a file from the client machine to process. I have to provide a installation steps to install. If i do it as a click one instillation, do i still get a security error? If so what is the best way to resolve it? If i install it in remote server, I sa...

Adding Rows to Gridview without using databind

Hello, I have a gridview inside of a listview predefined in the xaml: .... <ListView x:Name="listPriority" IsSynchronizedWithCurrentItem="True" Margin="0,30,0,4" BorderThickness="0,0,0,0"> <ListView.View> <GridView> <GridViewColumn x:Name="grvPriorityColumn" Width="140" Header="Priority" /> <GridViewColumn x:Name="grvMessage" Wid...

overlay for WebBrowser contorl in WPF application?

can give somebody me a hint how to display "overlay controls" in the WebBrowser control in my WPF application? I'd like to display navigation graphics as overlay so the user can select a function and the navigation controls disapear after selecting it. not really experienced in WPF for now. :( i have no idea where to start. any hint or...

Giving a WPF ItemsControl a different look based off whether ItemsSource holds a single value or multiple values?

Are there any slick ways to style/template a WPF ItemsControl differently based off whether ItemsSource holds a single value or multiple values? What I've done so far is to create a custom ItemsControl class which among other things displays the list of bound items as a horizontally oriented comma separated list. So far I'm pretty happy...

How to know when an ItemsControl has overflowed its ScrollViewer?

How would one swap a template by using a Trigger when the items within an ItemsControl overflow its container? In my current implementation I would like to show a more brief form of template based on whether the current state of the ItemsControl are such that the content would cause a ScrollViwer's scroll bars to appear if the scroll ba...