|
Maybe adjust the left margin on the element that displays the node.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I adjusted Padding on the Label that I put in the node and my problem has solved 
|
|
|
|
|
Hi, i am not sure if this is a good place to ask the following, but...
is there a method to export/import a playlist into Windows Media Player (10 and above?)
I'm creating a media manager database in Access 2007. I will have a collection of various files (audio, video, images, .PPT, .DOC, ..). If i could build a playlist containing a collection of my files, I want a format that can be imported into Windows Media Player.
I see iTunes has a feature that allows Import/Export of a playlist and thought something might also exist in the Microsoft environment.
Thanks.
|
|
|
|
|
|
This is a silverlight forum, so unless you are doing something with it, this is not the best place to ask this question.
The Lounge[^] may be a good place to bring this up (so long as you're dont discuss any code related issues there).
|
|
|
|
|
Hi,
I am working on a silverlight application. In this I created a silverlight page named Page.xaml. Then this silverlight page is used or embedded in a aspx page named Home.aspx. In Home.aspx I wrote javascript function. This javascript function should be called whenever I click on the button in Page.xaml.
i.e., on clicking a button in Page.xaml I have to call the javascript function in Home.xaml provided Page.xaml is in Home.aspx and all these are in a same project.
If anyone have any idea to do this please reply me.
Thanks in advance.
|
|
|
|
|
|
|
Hi Nekkantidivya,
Use HtmlPage.Window.Invoke() method to give the JavaScript call from your silverlight application.
Suppose the name of your javascript method is: SayHello(), then call the following from your button click event implementation:
HtmlPage.Window.Invoke("SayHello");
Let me know if you have any issues.
Regards,
- Kunal Chowdhury ( My Blog)
|
|
|
|
|
Hi,
I created one WPF dll usig C#.And im using that in VC++.I added that WPF control.dll through add reference.
But i nedd is, when i click the button in that WPFcontrol.dll,it should invoke the fucntion in vc++.
Eg:
If i created one MFC dialog in VC++,when i press that button in WPF control,it should show the dialog created in vc++.
How can i do that. Pls help me.
Anu
|
|
|
|
|
I have not seen WPF so I may be wrong here.
You should, if possible, create a delegate for the button click in your WPF dll. Then, wherever you use that dll, handle the click event in the parent form/page.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Hi there!
I have an object called "user" on the codebehind of a mainpage that shows if is anyone signed up on the webpage. The structure of the silverlight app is: a mainpage and a navigation:frame inside. I want to access to public object "user" from the navigation frame. the navigation frame is a xaml navigation:page.
How can i do it from the codebehind?
thnks! 
|
|
|
|
|
Application.Current.RootVisual will get you the top level element from
anywhere in the code.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
And the codebehind too? Ok, thank you, when i finish my work time i will prove it 
|
|
|
|
|
javixuwi wrote: And the codebehind too?
Yes. There's no difference between the code-behind code and
the code produced from XAML
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi, this is my first post in this forum. Codeproject is a good source for nearly everything i need.
I use Visual Studio 2008 SP1 and have Silverlight 3.
I made: new project -> C# -> Silverlight Application
I have to read a xml-file and i wanted to use the XmlReader-class:
XmlReader xmlReader = XmlReader.Create(@"C:\Dokumente und Einstellungen\THI\Desktop\stage2.xml");
An Exception occured: file is not in the xap-package try to use fetching the file with HttpWebRequest. (something like this)
I tryed to make this example work:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(VS.95).aspx#Mtps_DropDownFilterText[^]
I dont understand how to write the RequestState class and i dont understand what is: allDone.WaitOne() or allDone.Set()
Is here anybody who can explain this?
I tried to write RequestState class:
public class RequestState : IAsyncResult
{
private HttpWebRequest myRequest = null;
public HttpWebRequest Request
{
get { return myRequest; }
set { myRequest = value; }
}
private HttpWebResponse myResponse = null;
public HttpWebResponse Response
{
get { return myResponse; }
set { myResponse = value; }
}
private Stream myStream = null;
public Stream StreamResponse
{
get { return myStream; }
set { myStream = value; }
}
private byte[] ReadBuffer = new byte[1024];
public byte[] ReBuffer
{
get { return ReadBuffer; }
set { ReadBuffer = value; }
}
private StringBuilder myStringBuilder = new StringBuilder();
public StringBuilder RequestData
{
get { return myStringBuilder; }
set { myStringBuilder = value; }
}
}
Greetings
Thi
|
|
|
|
|
First - your URI @"C:\Dokumente und Einstellungen\THI\Desktop\stage2.xml"
is not going to work. Silverlight runs on the client and does not allow
direct access to the client's file system without asking the user first,
using the OpenFileDialog class.
The XmlReader.Create() method that takes a URI string only works for files
packaged in the Silverlight application's XAP file.
If the XML file you need to open is on the client's computer, you
need to use OpenFileDialog, not HttpWebRequest.
So where is the XML file you need to load?
Thi**01 wrote: I dont understand how to write the RequestState class and i dont understand what is: allDone.WaitOne() or allDone.Set()
All web requests in Silverlight are asynchronous. That means
the request is sent, processing continues, and at some later time
when a reply is received, the app is notified.
The example code you linked to uses an EventWaitHandle to wait
on the requesting thread until the reply is received, then continues
processing, essentially making the web request synchronous. IMO
it's a bad example - a reply could take many seconds, so if the
request is made on the UI thread, you've halted the UI thread,
which could lead to a bad user experience.
allDone is an EventWaitHandle or one of its derived classes, so if
you're new to threading, you may want to look at that documentation.
The RequestState can be anything you want - an existing object of any
class. Its purpose is to allow you to pass something across the asynchrounous
call. Whatever object you pass in the request will be available to you in the
reply.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Thanks, im at work now and going to try your tips, then i post again!
|
|
|
|
|
The tip with the WebClient worked for me.
I will explain what the point was.
You have to know this:
http://msdn.microsoft.com/en-us/library/cc645032(VS.95).aspx[^]
What this text says is, that the Silverlight-Runtime looks first for a certain security-file when a resource is called from a server: the clientaccesspolicy.xml. When this file is not correct or not there at all then a security exception is thrown.
The problem was:
This file was not there so i had to put i manually on my localhost.
(I have apache. The clientaccesspolicy.xml has to be put in the htdocs folder.)
clientaccesspolicy.xml :
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from>
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
This is my Silverlight App :
public void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
Debug.WriteLine(e.Result);
}
public void XmlReadTest()
{
Uri url = new Uri("http://localhost/stage2.xml",UriKind.Absolute);
WebClient client = new WebClient();
client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
client.DownloadStringAsync(url);
}
Nice Closing Time
|
|
|
|
|
|
The Invoke method in WPF was moved to the Dispatcher object, which can be accessed via the Dispatcher property on the TextBox.
|
|
|
|
|
thank you very much
I was really confused
|
|
|
|
|
|
Mohammad Dayyan wrote: I'm gonna create a MenuItem like
Kind of conflicts with
Mohammad Dayyan wrote: Could you please guide me how I should do it ?
doesn't it?
Try, when you have a specific problem post your code and someone will probably help
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|