|
Code is running on a client webpage. It streams data to a web user for live updates.
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
earlgraham wrote: Code is running on a client webpage. It streams data to a web user
So this code is in the Silverlight application then?
In that case, doing everything in Silverlight seems
the most logical.
I'm curious how you are able to provide a listener socket
in an application running in a browser...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
There is much I don't know about silverlight but there seem to be support for TCP connectivity in silverlight. Here is a good post on it.
http://weblogs.asp.net/mschwarz/archive/2008/03/07/silverlight-2-and-sockets.aspx[^]
My only concern is working through a binary message byte by byte to convert it into my managed code. I know there are several libraries that are not supported by Silverlight, and I hope that I don't get stuck.
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
earlgraham wrote: there seem to be support for TCP connectivity in silverlight
Connecting, yes, but listening for connections?
earlgraham wrote: working through a binary message byte by byte to convert it into my managed code
The BitConverter class is handy for that. For strings,
the Encoding class can help.
Of course, if you're unable to parse and/or decompress the data
from Silverlight code with its limited .NET framework, then you
will probably want to consider serializing the data in a format more
Silverlight-friendly.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It will not be listening. Only requesting data from a server that hosts the data. Sorry I miss understood.
Yeah its a tough decision, there are several options for me.
1) I can edit the data server, but its an established C++(unmanaged) application. I will have several of the senior programmers grilling me on whether I screwed up anything.
2) I could write an app that uses a different port. Then all my silverlight traffic goes to that port. I convert the data and forward. (this is my preferred approach)
3) OR Convert in the silverlight app.
What fun!!!
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
I suppose option 2 is the most flexible, since you can
re-shape the data and use any transfer/serialization mechanism
available to Silverlight apps.
Have fun!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Can any one give a sample code of how to export datagrid to excel?
|
|
|
|
|
And the journey is complete. This is a clueless post. You can't export a datagrid to Excel. You would export the DATA to Excel, and you'd do that the same way if you were using WPF or not. Ergo, this is not a WPF question and it's one easily answered with a google search.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Is there a way to change alignment of a column within a WPF ListView. I've got a Cell template like the following:
<DataTemplate>
<TextBlock Text="{Binding Path=C1}" HorizontalAlignment="Right">
<DataTemplate>
This doesn't work though because I've got to change the cell container's Horizontal alignment.
Also, when using a ListView.ItemContainerStyle, is it possible to trigger off the column by a name or index? As an example, how would one make the background of a column red from the ItemContainerStyle?
Thanks in advance!
|
|
|
|
|
Are you talking about the content alignment of column cells or the column alignment within the listview?
For content:
I think you may want to use HorizontalContentAlignment="Right".
|
|
|
|
|
On which object do I set HorizontalContentAlignment? The TextBlock doesn't have it. I'm sure the container that the text box is in has it, but how do I reference that object to set the value?
|
|
|
|
|
My mistake, I was thinking TextBox, not TextBlock.
For TextBlock Use: TextAlignment="Right"
|
|
|
|
|
Although, this works if the TextBlock's width is specified, I really want to right align to the ListView's grid column and allow the TextBlock's width to expand or contract with the column.
By specfiying a width to the TextBlock, when the column is expanded beyond the width of the TextBlock, the text though aligned to the right of the TextBlock is not aligned to the right of the column.
I believe that one needs to modify the parent's panel's content alignment; though, how do I manipulate that style. Can I use a trigger within a Control template for the ListBoxItem? If so, how do I switch on the column number so that only specified columns are right aligned?
|
|
|
|
|
If the textblock has Height and Width set to "Auto" it should resize according to the parent, and setting the TextAlignment should be independent of the textblock size. However, I have not messed with the listview control much myself. I prefer the DataGrid provided in the WPF Toolkit. Sorry if this does not help.
|
|
|
|
|
Never used the WPF toolkit, but thanks for the pointer. The DataGrid appears to have a number of features that will make it a much more attractive solution. Thanks for the comment. That's just what I needed.
|
|
|
|
|
Hello
I'm scaling some Polyline s, and for some I want the thickness of the line to follow the scale, works fine by default, but for some I want to keep a fixed pixel width regardless of scale.
Is that possible in some simple way or do I have to calculate the StrokeThickness myself?
thanks in advance
Niklas
|
|
|
|
|
Niklas Lindquist wrote: I'm scaling some Polylines
How are you currently doing this?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Oh, sorry, I'm setting a TransformGroup containing a ScaleTransform and a TranslateTransform , on the Polyline s RenderTransform property.
I managed to recalculate the width, but it adds a lot of overhead in adding a number of event handlers. So I'm still interested in a simpler way to do this.
/Niklas
|
|
|
|
|
Niklas Lindquist wrote: I'm still interested in a simpler way to do this
I don't know of a simpler way. My guess is that you'd need to
scale/translate the polyline points separately and create a new PolyLine
from those points if you want to prevent the strokethickness from getting
transformed.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That's just as bad as recalculating the width I'd guess (if not worse, performance wise).
Thanks for taking the time.
/Niklas
|
|
|
|
|
hello everybody Iwant to create video chat application in wpf and that should be peer to peer. I developed an application by looking article at codeproject wpf/wcf peer to peer chat application . But thats simply broadcasting my video to other peers and when the other peer starts sharing his cam then the both stream mixes up and I get output on my screen in which the streams of both the users mixes up and I we see pictures of both the users alternatively. and moreover it has performanve issuses also. video quality is perfect but speed is very very slow. So plz guide me how to do this???????????
|
|
|
|
|
I suspect you need to fix the code you're using to not send both streams across the same connection, and that you need a faster internet connection to get good video.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for replying but can u suggest me someway. how to do this.In my peer to peer application there is only one function that I have declared in the interface and is automatically called for all the nodes in the mesh. and that fnction is accepting "stream " of the person who started sharing his video to others,and this fnctio is called for each node, If now some other user starts his video sharing then it will again call the same function that was already running for this user and the rest of users and at thuis stage both the streams get mixed and I havnt found a way to separate these streams and call the function that is accepting stream.
|
|
|
|
|
HI,
This is from Chandrakanth.
Working on WPF Project.
Actually i have one CheckButton called as CheckALL. I have one DataGrid.
DataGrid Consist of some rows.
I want to Click on that CheckAll Button than all the rows in DataGrid should check.
How can i write that in WPF. Can any one tell me about that.
Thanks and Regards
Chandrakanth
Responses
|
|
|
|
|
You would have a boolean property on the data, let's call it Selected. Then you bind your checkbox to the property, and your code simply updates the data - leaving the binding engine to ensure that the checkbox is updated as a result. Don't try to do something like this in the UI, use the data to control it.
"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
|
|
|
|