For the images in my application, I have been setting the source property of my image to a JPEG file on disk but, as part of my next iteration, I want to test keeping them in memory for speed.
How do I tell the WPF Image control to get its information from an in-memory source rather than from a file?
...
What I want to achieve: To collapse or expand all Expanders that share the same group name within a group style.
We have a ListBox and another ListBox nested inside it to display child items. The child items ItemsSource is bound to a CollectionView with Group descriptions attached.
The group item template is quite simple:
<Expander Is...
Hi,
I have a listbox defined like this:
<ListBox.ItemTemplate>
<DataTemplate>
<ItemsControl>
<!-- Contents here -->
</ItemsControl>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
My problem is this: This l...
I'm using mvvm for my new project. I have a message dispatcher to send messages between viewmodels but in one case I have to receive messages in a view.
This view contains a toolbar panel that must contain the toolbar related to detail view (example editing a customer needs a toolbar with Save, Undo, Redo, Cancel).
The problem is that I...
Hi,
How can I get the Height and Width of the Browswer .
I tried using :
double Width = (double)HtmlPage.Window.Eval("screen.availWidth");
double Height = (double)HtmlPage.Window.Eval("screen.availHeight");
But this Returns the Current Screen Resolution. But I need to handle Some Controls like Media Element Height and Width When t...
I have a WPF form that I am trying to use with a SQL Membership Provider we have setup. My App.Config looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<clear/>
<add name="IodConnString" connectionString="server=SQLSERVER;UID=USER;PWD=PASSWORD;DATABASE=DATABASE;" providerName="Syst...
I have a TreeView wich has many types of items but they all inherit from a base class. Besides the TreeView there is a MasterDetail view for the selected item.
Below the MasterDetail view I wan't to have a edit button that changes the MasterDetail view into edit view.
I'm doing this by having the master detail view as a ContentPresente...
Hey,
is there a way to have a WPF UserControl Class to be a class with a Template type?
e.g.
public partial class MyControl : UserControl
should be:
public partial class MyControl<MyData> : UserControl
as I always get compile errors that MyControl than has no reference to InitializeComponents which is in the automatic generated pa...
I have a treeview that shows the current file system. I want to add functionality to enable dropping files into windows explorer. If I drag any of the node of my treeview and drop it on any of the window of Windows explorer then the file will be copied to that location. How can I accomplish this?
...
I have a test project which bases on :
http://thejoyofcode.com/ViewModels_and_CheckListBoxes.aspx
I want display field of object, not entire object. How to convert this
<ContentPresenter Content="{Binding Value}" Margin="1"/>
to this
<TextBox Text="{Binding Path=Name}"></TextBox>
and still have a object :)
<Window x:Class="WpfA...
I've got a View (MainView) which contains a kind of main content area (MainContent). The View is backed by a corresponding ViewModel (MainViewModel). The main content changes, of course, based on the current state of the application and is represented in the ViewModel as a property (CurrentPrimaryViewModel). The content of MainContent...
I am designing a master/detail view. Currently, I have a user control (detail) in my main view, and both have thier own vm. On the one hand, I think there should only be one vm because the detail will never exist without the master. It would also be easier to handle the CRUD process in one vm because of their tight dependency on one anot...
Let's say I have the following dummy class:
public class Foo
{
public Image MyImage
{
get;
set;
}
}
and I have the following in some XAML
<Image Source="{Binding Foo.MyImage}"/>
If I understand this correctly, this doesn't work because Source is expecting a URI string value fo...
I am getting following error:
"COM object that has been separated from its underlying RCW cannot be used."
I am sure the problem is because COM object is being called not on the thread it has been created - STA. I tried to implement IDisposable but it has not worked for me.
There is a couple of posts dealing with similar problem but ...
Hi,
I have a WPF UserControl that i am using in a Windows Form using ElementHost.
I am passing data from my Winform to my UserControl using a ListCollectionView.
In my UserControl i have a method setdataSource where i am setting the datasource.
But i keep getting this message in the output window when i debug my program
"System.Wind...
Hi,
TextBox is supposed to show masked dollar amount for certain access privileges. I created a converter class(inheriting from IValueConverter) to handle masking by implementing the convert method.
public object Convert(object value, Type targetType, object parameter,
CultureInfo culture)
The third parameter is p...
We have a Logitech web cam that we want to get working with .NET. It needs to recognize the device, and be able to take a picture. We just installed VS 2008, and I was wondering if Microsoft made it easier to interact with devices with some of the newer stuff like WPF, Silverlight, or whatever. If anybody can point me in the right dir...
I have the XAML shown below (for example). If you drag the grid splitter as far as it goes to the left, and keep dragging the mouse, the right-hand column will grow in size outside the bounds of the window - obviously not what I want.
The problem is that I can't set a hard MaxWidth on the right-hand column because the user can resize th...
I've got a test collection setup as :
ObservableCollection<Person> MyselectedPeople = new ObservableCollection<Person>();
public MainWindow()
{
InitializeComponent();
FillData();
}
public void FillData()
{
Person p1 = new Person();
p1.NameFirst = "John";
p1.NameLast = "Doe";
p...
How can I format a decimal value conditionally in a WPF window?
Value should be rounded to a whole number (Ex: 1,234)
When the value is 0.00, it should display as a single zero. (Ex: 0)
Currently I use bellow mark up to format the decimal value, but it displays 00 when the value is 0.00. Please help.
<TextBlock Grid.Column="6" Paddi...