|
Hi sir,
Thanks for that great help. but can you please tell me how to change the styles for dates shown in the calendar . In other words if i want to change the font size of the dates displayed in a month view what should i do? i think it is "CalendarDayButton" style. how to use this in our application?
My actual purpose is to change the style of the available calendar of the wpf with additional functionalities. Is that possible?
Thanks
Jithesh
|
|
|
|
|
Member 4070815 wrote: i think it is "CalendarDayButton" style
Then set CalendarDayButtonStyle and see what happens. For example,
red dates with a font size 10:
<wpftk:Calendar >
<wpftk:Calendar.CalendarDayButtonStyle>
<Style TargetType="Button">
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<TextBlock Foreground="Red" FontSize="10" Text="{TemplateBinding Content}" Margin="5" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</wpftk:Calendar.CalendarDayButtonStyle>
</wpftk:Calendar>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
Hey Mark thanks for the reply.(But I couldnt do that. may be the way i done is wrong note: the way i done is explained last please have a look)
Hi all,
Is there any way to find the number of week corresponding to the row in the month view. I mean the when the month view is displayed can we calculate number of week for a corresponding row ?forexample : In 2009 calender the 1 row of february month is the 6th week of the year. Is there any way to do this??
Hey Mark please have a look at this too :
The way i done is given below.
step 1: just added a datepicker with a "CalenderStyle" metioned.
sTEP2 : Created a Calendar style with a key and that key is refered in the Date picker. In this Calendar style i added in a stack panel the style for CalendarItem .
Step 3: Created the style and template for CalendarItem .
Now tell me where to use the code you given to me.
Thanks
Jits
|
|
|
|
|
Hi,
I am working on silverlight aplication. In this I used a WCF service. In this service I have a method like this:
public Array AdRotatorFilesList()
By using this service I need to get the Array value in to the array in my silverlight application. For this I wrote code like this:
Service1Client objt1 = new Service1Client();
objt1.FilesListAsync();
objt1.FilesListCompleted += new EventHandler<FilesListCompletedEventArgs>(DisplayResults);
void DisplayResults(object sender, FilesListCompletedEventArgs e)
{
string[] img= e.Result;
}
For this I am getting an error like this:
cannot implicitly convert System.collection.objectmodel. observablecollection<object> to string[]
If have any idea to get the return value of the array from the service to silver light application, please reply me.
Thanks in advance.
|
|
|
|
|
The error is telling you that you are returning an observable collection of objects to the client. If you look at your declaration, you can see that you have declared it as an Array - which is basically a container for objects. Where do you think the string is in this?
I assume you want to return a list of strings. If so, change your declaration to
public List<string> AdRotatorFilesList() and populate it with the relevant strings.
"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,
I am working on a silver light projrct.In this I need to upload an image and save it in a folder in the server(i.e., in a folder in the application). I want this funtion to be done on button click. So I cannot use file upload control. For getting the images I used open dialog. Now I have to sae the image.
If anyone have any idea to save the image to folder please reply me.
Thanks in advance.
|
|
|
|
|
If you are selecting a file by using OpenFileDialog then you will get the stream, right?
So, you can do http-post this stream to your web service.
Please check this example:
Silverlight File Upload[^]
Note: It's not possible to do without using any web service.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
You'll need to wire in a WCF service at the server side. The service would take the file information and byte array, then store it locally.
In your Silverlight application, you'll reference the service, then take your image data and send it.
To get to the image data, most likely you'll send it into a WriteableBitmap and then parse the Pixels array ... you can either format it on the Silverlight side and send it down, or send it raw and handle formatting on the server. Perhaps simple compression in the client, then uncompress and format into JPEG/PNG/etc on the server would be fine.
|
|
|
|
|
Hello all,
I have a small bit of silverlight code that pulls some data down from a silverlight-enabled web service and binds to it. I'm currently doing the bulk of the work in the constructor. Once the data is down, I bind to it in a couple of places and it is also accessible via a property on the code behind. However, I also have some controls that need to bind to this property in order to provide a list of values on screen. Is there a way to do this with the XAML binding syntax, or do I need to do this in the code behind?
Thanks,
Will
|
|
|
|
|
What about this?
For example:
<UserControl ...
xmlns:model=".........."
>
<UserControl.DataContext>
<model:YourClass/>
<UserControl.DataContext>
<ListBox ItemSource="{Binding YourPropertyOfYourClass}" />
</UserControl>
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
Sorry about the slow response, it took longer to recover from vacation than I thought (I had to wait until I was off to have time to start learning silverlight).
Your suggestion worked, so that means I don't understand the whole DataContext thing like I thought I did. I thought the control got it from whatever control contained it, but that is apparently not the case. Strange.
Anyway, thanks for the help, I really appreciate it.
|
|
|
|
|
Ugh. I told you wrong. I forgot I had put some hackish stuff in the code behind that set the ItemsSource.
Here's roughly what I have. It's buried down in one cell of a datagrid that is in a cell of another datagrid on the page.
<ComboBox x:Name="cboTextColor" SelectedItem="{Binding Color}" Grid.Row="2" Grid.Column="1">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Rectangle Fill="{Binding Color}" Width="25"/>
<TextBlock Text="{Binding ColorName}"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
There is a regular .NET property on the code behind page called ProductColors. It is currently an ObservableCollection<colorentry> (where ColorEntry has an id, a color code, and a description). It seems like I should be able to bind to it by doing something like:
<ComboBox ItemsSource={Binding ProductColors}" />
However, even though the list has two items in it, nothing shows in the drop down.
Does this need to be a dependency property or something for binding to work?
|
|
|
|
|
gantww wrote: It seems like I should be able to bind to it by doing something like:
<combobox itemssource="{Binding" productcolors}"="">
That depends on what "ProductColors" is. Assuming it's a collection of
ColorEntry objects, you still need a data context set somewhere so the system
knows where to find the ProductColors object to bind to.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
I'm creating a program to manage a competition which has several rounds. I have a class PreliminaryCompetition which contains a list of Teams and a list of Rounds, each Round containing a Result for each Team. I'd like to display the results of all rounds in a ListView control which has two columns to display team name and school name, followed by N columns to display results from N rounds. Is it possible to do this automagically with WPF binding? What do I have to implement to achieve this? (apologies - I'm a WPF noob)
Thanks
Jack
|
|
|
|
|
...someone wrote a Flash-based Silverlight engine. I'm sure that's not what Microsoft wants, but it would be instant ubiquity for Silverlight.
Flash has that fancy new native C converter, so I don't see performance being a huuuge issue. Considering MoonLight is open source, a ton of ground work has already been laid down.
Anybody up for a challenge? haha
|
|
|
|
|
It does already exist!
It's called Silverlight! Unknown to you it has been developed by Adobe people!
Of course you need to install a (very little) something to your PC (which does all the translation magic), but this all smooth and transparent!
Happy now?
In what way were you thinking of something different?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Did you read my post? A SILVERLIGHT engine that runs on Flash, in order to achieve instant ubiquity for Silverlight. So, you can develop Silverlight applications and not have to worry if the person has Silverlight installed _ as long as they have Flash installed, you could fallback to the Flaash based engine, point it at your XAP file, and BAM, the SL app runs in flash. There are tons of advantages to this. Silverlight is MUCH more developer friendly.
|
|
|
|
|
Mike Marynowski wrote: Did you read my post?
Did you see his joke icon?
"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
|
|
|
|
|
Yes, I saw the joke icon..."haha Adobe already did that" was the joke...but the "how is that any different" part is clearly not.
|
|
|
|
|
I treated the whole thing as a joke.
"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 think his follow-up question below makes it pretty clear it wasn't a joke :P
|
|
|
|
|
Yes.. this is very good point but it might not be possible.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
I think for the most part, it could be done...there would probably be some differences that would have to be taken into account, but I think they could be made minimal. I can't think of a Silverlight feature that couldn't be emulated in Flash.
|
|
|
|
|
Did you think about your question?
Let me formulate it differently.
What you want is a flash extension that runs .NET code.
Flash now can't do it. So it will need to be upgraded with a new installer which runs .NET code.
Now my point is: what is the difference with a new flash installer that runs .NET code and the current Silverlight installer that runs .NET code?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
I don't want a flash "extension"...I want a flash application that loads a specified XAP file (i.e. by passing in the path as an argument), parses the contents, and runs the Silverlight application. Basically, taking the MoonLight engine and converting all the low level browser stuff to run within the Flash engine.
*Edited for clarity
|
|
|
|