Here is the deal: I have a RichTextBox control and it works fine. The problem is that there is a button "Insert Current DateTime" which adds/injects the current datetime into the RichTextBox. The user can enter the datetime anywhere where the caret is pointing. This involves complicated string manipulation and stuff.
Any ideas how to g...
I'm learning C# and WPF by building a WMP-type app. The code below runs fine, selecting a movie from the listbox runs it in the media element. The problem I'm having is finding a way to automatically start the next movie after one ends. Thank You.
The xml file that provides a list of movies:
<?xml version="1.0" encoding="ISO-8859-1"?>
...
I did quite a bit of WPF a couple of years ago but seem to have forgotten everything.
Suppose I have a simple business class, say a TFS workitem.
public class WorkItem
{
public WorkItem(string name, DateTime date)
{
Name = name;
Date = date;
}
public string Name { get; set; }
public DateTime Date { ...
I have create a storyboard in C# to animation a scale transform on a canvas. The scale transform is a layout transform. Here is my C# code for the animation:
Storyboard Configuring = new Storyboard();
if (NexusRoot != null)
{
var current = (NexusRoot.LayoutTransform as ScaleTransform).ScaleX;
Duration duration = new Duration(TimeSpan.F...
I'm looking for a WPF theme that looks like Windows XP/WinForms. Basically I want all the WPF goodness, but without my business analyst freaking out because the colors look different.
(Pity too, I really like the themes I found on CodePlex.)
...
I have a treeview with 1000 items. When I select an item, the treeview fires an event so I can update something in my GUI. The event handler is non recursive and has no loops, but it does take a little bit of time to complete, maybe 100ms.
If I select the top item and use the down arrow to scroll through items slowly, everything works f...
I often need to display a list of files to the user, say, as a result of a search query.
Typically I describe my own simple DataTemplate for FileInfo. But I'm lazy to re-implement all the Explorer's functionality: the Views, Sorting, Context Menus and drag&drop.
I feel like the problem is common and someone has already assembled a go...
Hi I'm using the .NET Data Visualization Toolkit to create charts in WPF. My application basically adds a new value to the chart every second and redraw the chart. The problem is that I only want to display 100 points on the x-axis at any given time but the chart seems to redraw itself with all the values. Is there a way to display a ...
I have several menu items like this:
<navigation:RadMenuItem Header="New Assignment">
<navigation:RadMenuItem.Icon>
<Image Source="/Images/New_Assignment.jpeg" Width="20" Height="20" />
</navigation:RadMenuItem.Icon>
</navigation:RadMenuItem>
<navigation:RadMenuItem Header="New Course">
<navigation:RadMenuItem.Icon...
is it possible to make a ChildWindow like ChildWindow in Silverlight, but for WPF? I tried to adapt the Silverlight ChildWindow to WPF but ran into issues with Transformations and not being able to set the Popup's Parent. I'm trying to make something that works simular so I do not have to add code to the XAML for popups. Any ideas?
...
In a WPF application, how can I save a dynamically rendered page as a new XAML file?
...
Trying to bind to a collection in WPF, I got the following to work:
XAML:
<toolkit:DataGrid Name="dgPeoples"/>
CS:
namespace DataGrid
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1
{
private readonly ObservableCollection<Person> personList = new Observab...
I have a dialog with a few fields. Some of them use validation - ValidatesOnExceptions=True in my case.
I have a data object with INotifyPropertyChanged that I bind to dialogs' DataContext.
I also have a "Save" button. Validation works fine, but only after I edit each field.
If dialog is opened and closed immediately, validation will ...
Hi all
I am using WPF Toolkit released in June 2009 to create a column chart in WPF. (sorry but I cannot post image here)
graph
The problem is that It becomes ugly when the columns number increase. That the reason I want to use scroll bar.
thanks in advanced!
...
I have a form that binds to an ViewModel (MVVM). Inside the form I have an ItemsControl that is bound to an element called projects in my DataContext.
When I do a save using a command pattern I save the item and do a retrieve then I want to rebind the ItemsControl to the Projects collection. This part doesn't seem to be working, all m...
I am writing a text editor and need to provide a live word count. Right now I am using this extension method:
public static int WordCount(this string s)
{
s = s.TrimEnd();
if (String.IsNullOrEmpty(s)) return 0;
int count = 0;
bool lastWasWordChar = false;
foreach (char c in s)
{
...
I am Binding a TextBox with a property which is of type float. Everything works fine, I change the value in TextBox and it gets updated in property. The problem occurs when I make the TextBox blank, my property doesn't get updated, it is still having old value. Now I need to use converter in my binding to update property with default val...
Hi
I want to create a table like in Excel sheet. The table has rows' headers and columns' headers. How to make the rows header move when the vertical scrollbar is dragged and statistic when the horizontal scrollbar is dragged and vice versa for the Columns header like in Excel sheet. Does anyone have any ideas how to do it? Thank you ver...
Hello,
I have just implemented these ToggleButtons using ControlTemplates that set the Image content according to IsChecked stated. The images are made in Photoshop, but I want them as WPF vectors.
The buttons look like these when IsChecked=False:
And when IsChecked=True I just replace the Image with another PNG:
I've designed th...
I'm looking for something like a ContainerUIElement3D which supports the ItemsSource property and an ItemTemplate property which I can use within a Viewport3D. My aim is to be able to write something like:
<ItemsControl3D ItemsSource="{Binding Path=MyItems}">
<ItemsControl3D.ItemTemplate>
<DataTemplate3D> ...