|
I'm just trying to narrow down why you're getting poor performance.
I wouldn't expect lack of hardware rendering on a modern PC to matter much -
it will use more CPU and RAM maybe but it still should play smooth, unless you have
a real low-budget video adapter.
The part I distrust most is setting the source at runtime. The first time
the source is set should be fine, but setting a new source over an old one,
even though it "should" work, may be a problem.
So if you hardwire the source like I showed, just for testing purposes, is the
performance still crappy?
Christian Graus wrote: size will depend on screen res. I'd have expected that to be a common need.
Common need, yes, but have you tried it at native resolution, just to see?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I wrote an app that runs at native resolution for each vid. I think the problem may be that my WMVs are 1200 wide. I think we can go smaller without it looking bad (HD is 1080, DVD is 800 ). I used to download lots of music videos, they are typically 400 wide and they all play great.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian - sorry I haven't got back to you sooner as I've been off CP all weekend. How are you getting on resolving this issue? Do you need more help or have you got it sussed?
"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
|
|
|
|
|
I have a webservice with 3 webmethods.
Now in my client application i want to consume the above service without adding web reference .
In my client application i have url of Web service and webmethods name in the form of strings.
For example: webmethod name: HelloWorld() or add(int x,int y)(Parameterd one)
So i don't want create object for webservice and i don't want to call it as instance.HelloWorld()
I have information of webservice in the form of URL and method name like "HelloWorld"(like string)
I don't know how can I move forward?
Could anyone please provide me the solution?
It is helpful if you can explain with some example code.
|
|
|
|
|
While I wouldn't normally call the web service without a service reference in place, it's a simple enough process. Basically, you have to build the web request yourself and then call it. The following snippet should give you an idea of how it works. I'll leave it to you to work out what your data will be and what your response will be, but this should be a useful starting point:
string data = "xmldocument";
string url = "myurl";
string response = string.Empty;
byte[] buffer = Encoding.ASCII.GetBytes(data);
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
request.Method = "POST";
request.ContentType = "text/xml";
request.ContentLength = buffer.Length;
using (Stream post = request.GetRequestStream())
{
post.Write(buffer, 0, buffer.Length);
post.Close();
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
using (Stream responsedata = response.GetResponseStream())
{
using (StreamReader responsereader = new StreamReader(responsedata))
{
response = responsereader.ReadToEnd();
}
}
}
"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
|
|
|
|
|
Hello,
I'm new to WPF and I'm having difficulties with something. In my .xaml file I have a grid with some columns and rows and many controls (labels, buttons, etc.) inside it. In the end I have a frame and I want to be able to scroll inside that frame (since the second column of the grid is bigger that the grid height).
I tried doing something like this:
<ScrollViewer>
<Frame ScrollViewer.CanContentScroll="True" ... />
</ScrollViewer>
but it doesn't work. What am I missing here?
Thanks in advance
<div class="ForumMod">modified on Friday, March 20, 2009 8:56 AM</div>
|
|
|
|
|
AFAIK, SCrollViewer doesn't have a CanContentScroll attached property.
Generally if you wrap an element in a ScrollViewer, you set the wrapped element's
CanContentScroll (where applicable) to false and let the ScrollViewer do the
scrolling.
Can you show a more detailed example - i.e. more XAML showing the grid
surrounding your ScrollViewer?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi everyone, I'm kind of new to the silverlight scene. So I wanted to take a silverlight control i made, which is my companies name (in a textbox), that does some small graphical things, and add it to the top of my master page... my companies site is www.lumetix.com and I would like to put the silverlight control in place of the "LumeTix" text at the top of the master page. If anyone can give me any info or direction, it would be greatly appreciated.
|
|
|
|
|
|
Thanks a bunch for that!! Looking forward to diving into it!
|
|
|
|
|
Why is it htat in WPF, I make an object invisible and it still covers the UI so that stuff underneath cannot be clicked ? It makes XAML animations useless. I can fade something out, but I still need to catch the event where the animation ends so I can mark it as collapsed.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
By design?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yeah, I bet. But, for what purpose ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
I am trying to develop a CPU utilization Chart in Silverlight but can't seem to include System.Diagnostics.Process in the project. Can someone please point me in the right direction and advice me on the best way to implement the CPU utilization function.
I am using a Gauge to show my CPU utilization
Thanks
|
|
|
|
|
AFAIK you can't get the CPU usage info from a Silverlight application.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi All. I am working on a project with WPF (DataGrid) and ADO.NET EF.
The relevant piece of the EF model is shown below. Notice the *--* relationship between Location and ArticleClass.
EF Model[^]
The datagrid in the right hand upper corner (A) lists all the names of the ArticleClasses
The datagrid on the bottom (L) lists all the available Locations.
WPF Form[^]
What I want to do is, when I check the CanHaveAsArticle checkbox of a certain ArticleClass in (A), that a relationship is made (remember the *--*) between the selected Locations in (L) and the checked ArticleClasses in (A).
How can I do this using databinding?
I've tried a ValueConvertor but the instance doesn't know which rows of (L) are selected.
[...]
<my:DataGrid.Columns>
<my:DataGridTextColumn Header="Name" Binding="{Binding Path=Name}" IsReadOnly="True" />
<my:DataGridCheckBoxColumn Header="CanHaveAsArticle" Binding="{Binding Path=Locations, Converter={StaticResource myRelationshipManager}}" />
</my:DataGrid.Columns>
[...]
I've thought about binding it to a property in the Window.xaml.vb file where the setter creates the relationship (something like Location.ArticleClass.Add(L.SelectedRow)) and the getter checks whether there is a relationship, but I dont seem to find out how.
Thanks,
Wouter
|
|
|
|
|
I have a WPF application with a ListBox containing the following values:
Item0
Item1
Item2
Item3
Item3
Item2
When an item is double-clicked I have a MessageBox showing "item " + ListBox1.SelectedIndex.ToString() + " was selected.". The SelectionMode for the listbox is set to Single.
Everything works fine for the first 4 items, double-clicking Item0 shows item 0 was selected. However, the last two show the first item that matches that value. Double-clicking the second Item3 says item 3 was selected when it should be item 4 and the second Item2 says item 2 was selected when it should say item 5. Also, the selection highlight will highlight both lines and leave one of the duplicates highlighted even when one of the items without a duplicate is selected.
What do I need to do to get the last two items to show that they are the ones being selected? Why is WPF looking at the value instead of the individual items? This works fine with a windows forms listbox.
Thanks for any help,
Brad
"You know you're a geek when... You try to shoo a fly away from the monitor with your cursor. That just happened to me. It was scary." — Juuso Heimonen.
|
|
|
|
|
It work's fine on my machine - proper index and no multiselection. This is what I am using,
<ListBox Name="mulList" MouseDoubleClick="ListBox_MouseDoubleClick" SelectionMode="Single">
<ListBoxItem Content="Item 0"/>
<ListBoxItem Content="Item 1"/>
<ListBoxItem Content="Item 2"/>
<ListBoxItem Content="Item 3"/>
<ListBoxItem Content="Item 3"/>
<ListBoxItem Content="Item 2"/>
</ListBox>
private void ListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
MessageBox.Show("item " + (sender as ListBox).SelectedIndex.ToString() + " was selected.");
MessageBox.Show("item " + mulList.SelectedIndex.ToString() + " was selected.");
}
|
|
|
|
|
Forgive me, but I'm still a little green with WPF. Your method worked fine for me when I added ListBoxItems at design time.
I was adding string items to the ListBox at runtime by:
ListBox1.Items.Clear();
for (int i = 0; i << listOfNames.count(); i++)
{
ListBox1.Items.Add(listOfNames.name[i]);
}
If I create a ListBoxItem and set it's content to the name and then add it, that worked:
ListBox1.Items.Clear();
for (int i = 0; i << listOfNames.count(); i++)
{
ListBoxItem listBoxItem = new ListBoxItem();
listBoxItem.Content = listOfNames.name[i];
ListBox1.Items.Add(listBoxItem);
}
I was using ListBox1.SelectedItem to return the value (in my case name) of what was selected. Now I have to create a ListBoxItem, set it to the SeletecdItem, and then grab the content. So much for thinking it was simple.
Thanks again for your help.
Brad
"You know you're a geek when... You try to shoo a fly away from the monitor with your cursor. That just happened to me. It was scary." — Juuso Heimonen.
|
|
|
|
|
I have the same problem. I think it's a bug in WPF.
I'm using .NET 4.0 Beta 2 on VS2010 and I'm on Windows 7RC. The application itself is targeting .NET 3.0.
|
|
|
|
|
Hi All,
I keep seeing examples using this method but I simply cannot find it on the Dispatcher in my UI controls ... has this been deprecated in 3.5 SP1 or something??
Cheers,
|
|
|
|
|
|
|
This method has deliberately been hidden by Microsoft - they state that it's an advanced method that should only be used with care. We had lengthy discussions in the WPF Disciples about this issue.
"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
|
|
|
|
|
Gotcha. Thanks Pete ... do you have a link to that discussion?
Cheers,
|
|
|
|