|
Im trying to write a poker application in WPF and Im having trouble figuring out on how to animate "dealing of cards" from dealer to player seats.
The dealer position is located on the topmost-center position and each chair is located on every edge of the table.
The chairs are positioned and aligned using Grid using Grid.Column and Grid.Row this way when the window resizes all elements in the window follows up.
-How can i animate a card object from dealer seat to players seat position?
-What if the window resizes?
-how can i set the target for the animation?
for example, I would like to deal card at player seat 5 located at Grid.Row = 3 Grid.Column = 2?
by this the card animation will target the grid location of the said player..
Can you guys give me idea on how to do this?
Thanks,
|
|
|
|
|
Hi
Maybe you could switch the grid with something else, wich will give you more granular control over the position of the elements - maybe canvas. The other aproach I can think of is to animate the ScaleTransform of each element.
Uros
|
|
|
|
|
How can I set the Visual Studio as the default external editor in Blend 3?
I know that by right clicking on C# or XAML file I can get a context menu in which VS is one of the items. But I mean something different: in the Properties panel, under "Events", when I write the event name and then want to jump to VS in order to edit the event.
Thanks,
David
|
|
|
|
|
Sorry, this behavior is not present as best of my knowledge.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets
|
|
|
|
|
Thanks for trying to help. Meanwhile I found the answer:
In Blend 3, under Tools>Options>Project, there is an option: "Use Microsoft Visual Studio to create and edit event handler code…". And that is what I was looking for.
Regards,
David
|
|
|
|
|
Oh, Thanks David...
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets
|
|
|
|
|
hi,
I'm trying to create some kind of a wizard framework in wpf, but since I'm not too experienced in wpf I don't know how to solve certain things.
What I would like to have is a basic wizard and a basic empty wizard page that provides the "look" of every wizard I need in any part of my application, and, if possible, I would like to provide a basic functionality for the forward and backward buttons.
In a winform environment, I would create the wizard and the page as "usercontrols" and derive a certain wizard or a certain wizard page from those base classes.
I just don't know how to do it in wpf (the way it is supposed to be done in wpf). There seem to be so many ways,..styles, controltemplates, usercontrols, customcontrols, datatemplates...all I know for sure is that I want to use mvvm. And I know I should use commands for the button clicks etc.
I do not like the navigation approach in msdn..it's too weblike I think. Google didn't help either, I came across many wizards but they all had fix pages.
Actually I'm very fond of the internationalized coffee wizard by Josh Smith and Karl Shiffet here on codeproject, but it has fix pages, too.
I hope somebody can point me in the right direction (what should I use,..usercontrol, controltemplate,...?).
thanx a lot in advance
sth_Weird
|
|
|
|
|
|
thanx for your reply!
actually in my initial post I mentioned that I do not like the Navigation example on msdn because it looks so weblike...but well I thought I might google for it a bit more and see if I could find any better examples (I am not fond of the msdn examples, they are small and do their job but most of the coding is bad).
I found out it is possible to restyle the frame/page system so that it looks less weblike and more like a decent software wizard. Maybe it's not that bad after all.
I'll give it another try!
sth_Weird
|
|
|
|
|
Hi, in the mean time I am responding you.
I was suggested you, to use NavigationService using Frame with windows. This will not behaving like browser application.
After 1 or 2 hours I will post you sample code.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
thank you very much for your help!
it is very kind of you to offer me sample code, but since I want to dive deeper into wpf and not just "copy, paste (and edit)" I will try to implement it on my own (I am experienced in c# and I know the basics of wpf, so I hope this won't be too much of a problem for me). I will return if I encounter problems!
sth_Weird
|
|
|
|
|
No problem. I like your sprit towards the WPF. Thanks
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
Have you worked with any of the commercially available wizards? It might give you an insight as to how it is actually structured.
I've only used the Actipro wizard which is pretty good. Might be worth going down this route to kick off some thought processes.
Cheers,
|
|
|
|
|
Thank you for your answer.
I've heard about the Actipro wizard but I don't want to use any commercial products (it says on the homepage it's only a trial, and the included source code shows how to use the wizard but it does not include the source code of the wizard itself).
EDIT: I think I'll give the navigation approach (frame/pages) another try, I've found a couple of useful examples of how to restyle it an make it look less weblike. Maybe it's not that bad after all.
sth_Weird
|
|
|
|
|
|
I have created a wcf services that are hosted in console application,and binding is done using netNamedPipeBinding. Now i am adding this service as a service refernces in silverlight .web part.
How can i use it to display data. Here wcf services uses database.
please put ur valuable comments
Thanks in Advance
|
|
|
|
|
If you succeeded in getting a service reference then you are halfway there.
Let's say you saved that reference as MyWcfService. That name becomes your namespace extension. So if your project is MyWeb, then your full service namespace is MyWeb.MyWcfService.
In your program you now have to find the name of your DataClient. After that the rest is a piece of cake.
MasterClient client = new MasterClient();
client.OpenAsync();
client.GetInformationEventHandler+=new EventHandler(ProcessResults);
client.GetInformation();
client.CloseAsync();
The event handler sets the CallBack from the asynchronous call.
The GetInformationI() call is actually whatever your calls are in your service. (event handlers are automatically generated for you)
You can make multiple calls to multiple methods on the same instance of the client. But if you have to make two calls to the same method, you need two separate instances of the client and two instances of the event handler. (such as loading the customer address and billing address)
|
|
|
|
|
I have created WCf services in console Application in C#. How can i use this services in silverlight .web part.using this services i have to display data.
|
|
|
|
|
You have already posted this question here.
Please do not repost....
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
I wish to bind 'Canvas.Left' of an ellipse to a property (iEllipse) of Class instance(bClass). This property gets updated from several locations. Following is the C# code:
namespace BindingTest
{
public class BindingClass
{
public int iEllipseLeft { get; set; }
public BindingClass()
{
iEllipseLeft = 30;
}
}
public partial class Window1 : Window
{
BindingClass bClass;
public Window1()
{
InitializeComponent();
bClass = new BindingClass();
}
private void updateLoc()
{
Random random = new Random();
bClass.iEllipseLeft = random.Next(0, 100);
}
}
}
And, this is the ellipse I want to bind. Basically I want to move this ellipse whenever bClass.iEllipseLeft gets changed.
<Canvas Margin="16,128,244,52" Background="#FFE8E8E8">
<Ellipse Fill="#FFFE0C0C" Width="32" Height="32" Canvas.Left= "5" Canvas.Top="48"/>
</Canvas>
Whether it is possible by writing '{Binding=..}' in .XAML or by coding in .cs file, please let me know. I'll be happy in either way. It might be a very simple question, but I've just started using WPF and C#, so please help
|
|
|
|
|
Hi
Try declaring EllipseLeft as a DependencyProperty. Below is a sample code
public static DependencyProperty EllipseLeftProperty = DependencyProperty.Register("EllipseLeft", typeof(int), typeof(Window1));
public int EllipseLeft
{
get { return (int)GetValue(EllipseLeftProperty); }
set { SetValue(EllipseLeftProperty, value); }
}
Than you can set up the binding in the xaml.
I hope this helps
Uros
|
|
|
|
|
Got the answer. Thanks koleraba! Just adding few bits and adjustments to your code to make it run.
Inside class, we need to define property something like this:
public class BindingClass : DependencyObject
{
public static DependencyProperty EllipseLeftProperty = DependencyProperty.Register("iEllipseLeft", typeof(int), typeof(BindingClass));
public int iEllipseLeft
{
get { return (int)GetValue(EllipseLeftProperty); }
set { SetValue(EllipseLeftProperty, value); }
}
}
Also in starting, we need to set data context of the object/canvas or Window:
BindingClass bClass = new BindingClass();
objEllipse.DataContext = bClass;
And, in .xaml file:
in stead of
<Ellipse Fill="#FFFE0C0C" Width="32" Height="32" Canvas.Left= "5" Canvas.Top="48"/>
write
<Ellipse Fill="#FFFE0C0C" Width="32" Height="32" Canvas.Left= "{Binding Path=iEllipseLeft}" Canvas.Top="48"/>
That completes the binding!!
|
|
|
|
|
I have just installed Silverlight 4 and all that other stuff from Microsoft because I wanted to use this technology on my web building, but I have never programmed in C#, Silverlight, .Net... I am used to html and css basics. Mainly building with Dreamweaver. (I want to expand my horizons) Now that I have have Silverlight, I am thinking of a website.
This website will be a carousel with 5 pictures of differnt pages from the site. Just needs a left/right control, each pic is a link to their repective pages, and I would be using a picture for the background.
If anyone can help me with this, I would truely appreciate it..
P.S. I have done a lot of research on many other sites, but they all have controls, needed assemblies.. Stuff I don't know about or don't know how to modify to my needs.
I need someone who can help me thru the process.
|
|
|
|
|
|
If you are a beginner, you should have a look at the two videos posted here.
|
|
|
|