|
Hi , there are many ways to do it
a) You can get one from codeplex
b) Infragistics control [ I am using this in my current project ]
c) You can use a List box in place of a grid.
d) Make google search for more information
Hope this helps
Niladri Biswas
|
|
|
|
|
I was wondering if anyone knew how I can give the user the ability to move an image element. Basically, I want to be able to allow the user to drag the image over a listbox and have a drop effect. Below is my xaml code:
<StackPanel Grid.Row="0">
<Border CornerRadius="4" Background="LightYellow" BorderBrush="Black" BorderThickness="2">
<Label x:Name="location" HorizontalAlignment="Center" Height="30" FontSize="12" VerticalAlignment="Center">Person Information</Label>
</Border>
<Image Width="150" Height="150" Margin="5" PreviewMouseLeftButtonDown="gridImage_PreviewMouseLeftButtonDown" PreviewMouseMove="gridImage_PreviewMouseMove" x:Name="gridImage" >
Image.RenderTransform>
<TranslateTransform x:Name="imgTranslate" X="0" Y="0" />
</Image.RenderTransform>
</Image>
</StackPanel>
I'm currently using the PreviewMouseLeftButton and PreviewMouseMove buttons to create a drop effect and this works fine; but I would like to make it more animated to where the user is actually dragging the image. Thanks.
Terrance C.
modified on Wednesday, June 3, 2009 11:37 AM
|
|
|
|
|
Check out Josh Smith's article on WPF Drag & Drop here on Code Project.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Thanks, for the information.
Terrance C.
|
|
|
|
|
Hi All,
I've recently been having bags of fun getting an app working on 32bit and 64bit windows. Since I don't have access to a 64bit machine getting a grip on the issues has been a complete nightmare. So I've opted to build the app specifically for x86 and run the app in WOW mode on 64bit machines. All good. I have had positive feedback on this having been successful and the app is running on 64bit.
However, a couple of thge 64bit testers have said they have noticed a fair dip in UI performance. None of the codebase has changed between the version they previously ran and this new x86 compiled version.
Has anyone else seen this with an x86 compiled app running in WOW mode on 64bit machines?
Cheers,
|
|
|
|
|
Hi
Does anyOne know how to style scrollbar of wpf datagrid. I saw articles styling scrollbars in general, but I don't know how to do it for wpf datagrid.
Thanks,
Vsaratkar
|
|
|
|
|
You essentially need to start out with the existing datagrid template and change the scrollbar to your liking, creating a new template along the way.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
If you don't want to copy the entire DataGrid template, the scrollbars
are named "PART_HorizontalScrollBar" and "PART_VerticalScrollBar"...you
could find those controls at runtime and set their style/template appropriately.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You can also take a scrollbar template like the example at
ScrollBar ControlTemplate Example[^] and put it
right in the DataGrid's resources (or any place in the resources "above" the datagrid.
If the style doesn't have a key then the DataGrid will automagically use it on its
scrollbars.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I was just going to say that, scroll bars are a great candidate for a typed style rather than x:key="" type. Nice and consistent.
|
|
|
|
|
Thanks Mark,
I achieved what I was looking for.
|
|
|
|
|
Hi,
What's a good method to bind Commands to Events? In my WPF app, there are events that I'd like to capture and process by my ViewModel but I'm not sure how. Things like losing focus, mouseover, mousemove, etc. Since I'm trying to adhere to the MVVM pattern, I'm wondering if there's a XAML solution for that.
Thanks!
|
|
|
|
|
These events are, strictly speaking, view only events, so why would you want them to be handled in the VM? There's no rule that says you can't have code behind the view, so if you need to do things, you can do it there. What are you trying to do that goes beyond the V/VM separation?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi Pete,
Those events were just examples. It can be any type of event that I might need to handle.
In our application we can change XAML files dynamically, so we're trying to avoid solutions that involve code-behind files.
Thanks!
|
|
|
|
|
|
Attached behaviours are a good way to go - and one I'm particularly fond of (see this[^] blog post for an example).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I don't know your actual requirement but ICommand can be helpful in such situations.
It makes your view cleaner.
May I get the exact scenario for the problem?
Niladri Biswas
modified on Thursday, June 4, 2009 10:32 AM
|
|
|
|
|
I suspect you meant to raise this against the OP, not me. He won't be notified of posts against my account, so could you reply to him instead.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I don't know your actual requirement but ICommand can be helpful in such situations.
It makes your view cleaner.
May I get the exact scenario for the problem?
Niladri Biswas
|
|
|
|
|
Look I marked the property Data:
[DataMember]
public List<object> Data
{
get;
set;
}
and I still have this exception dislayed:
"Method get_Data is not supported on this proxy, this can happen if the method is not marked with OperationContractAttribute or if the interface type is not marked with ServiceContractAttribute".
thank you !
|
|
|
|
|
And is your contract interface marked with ServiceContract? Have you placed your DataMember on the implementation and not the interface?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Here is approximately my code:
[ServiceContract]
public interface X
{
[DataMember]
List<y> Data {get;} //Y is a new type
}
[Data Contract]
public class Y
{
[DataMember]
public List<object> Data
{
get;
set;
}
}
Do I do any mistake?
|
|
|
|
|
The actual service contract is defined as an interface like this:
[ServiceContract]
public interface IMyInterface
{
[OperationContract]
List<int> DoSomething(MyData item);
} This contract will be implemented by a concrete class, and DoSomething will be visible to systems that consume the service. The DataContract is defined as a concrete class like this:
[DataContract]
public class MyData
{
[DataMember]
public int DataValue1 { get; set; }
[DataMember]
public string Identifier { get; set; }
} Then we define the class that implements the service contract like this:
public class ImplementInterface : IMyInterface
{
public List<int> DoSomething(MyData item)
{
return item.DataValue1;
}
}
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Excuse me I miss something:
[ServiceContract]
public interface X
{
[DataMember]
List<Y> Data {get;}
}
[Data Contract]
public class Y
{
[DataMember]
public List<object> Data
{
get;
set;
}
}
Having read your code I does not see why mine is incorrect
|
|
|
|