Click here to Skip to main content
15,921,905 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF namespaces reference Pin
RugbyLeague27-Apr-11 22:31
RugbyLeague27-Apr-11 22:31 
GeneralAnswers here! Thanks [modified] Pin
devvvy27-Apr-11 21:06
devvvy27-Apr-11 21:06 
GeneralRe: WPF namespaces reference Pin
Pete O'Hanlon27-Apr-11 21:53
mvePete O'Hanlon27-Apr-11 21:53 
GeneralRe: WPF namespaces reference Pin
devvvy28-Apr-11 16:55
devvvy28-Apr-11 16:55 
QuestionOpen a file from path on Hyperlink click in silverlight Pin
Piyush Nandanwar26-Apr-11 0:20
Piyush Nandanwar26-Apr-11 0:20 
AnswerRe: Open a file from path on Hyperlink click in silverlight Pin
Pete O'Hanlon26-Apr-11 0:30
mvePete O'Hanlon26-Apr-11 0:30 
GeneralRe: Open a file from path on Hyperlink click in silverlight Pin
Piyush Nandanwar26-Apr-11 0:41
Piyush Nandanwar26-Apr-11 0:41 
GeneralRe: Open a file from path on Hyperlink click in silverlight Pin
Pete O'Hanlon26-Apr-11 0:54
mvePete O'Hanlon26-Apr-11 0:54 
Well, you could always google Silverlight WebClient download file and see what you get. I did say that all the clues were in my original post. In future, I'd expect you to at least try to write the code yourself - honestly, it's not that hard. As I'm in a good mood though, you're going to need a variation of this:
C#
private void DownloadFileClick(object sender, RoutedEventArgs e)
{ 
  var webClient = new WebClient();
  webClient.OpenReadCompleted += new webClient_OpenReadCompleted;
  webClient.OpenReadAsync(new Uri(the path to the url here, UriKind.Absolute));
}
void webClient_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
  SaveFileDialog sfd = new SaveFileDialog();
  bool? result = sfd.ShowDialog();
  if (result.HasValue && result.Value == true)
  {
    using (var sr = new StreamReader(e.Result))
    {
      string str = sr.ReadToEnd();
      using (var sw=new StreamWriter(sfd.OpenFile()))
      {
        sw.Write(str);
      } 
    }
  }
}

Forgive your enemies - it messes with their heads


My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: Open a file from path on Hyperlink click in silverlight Pin
Piyush Nandanwar26-Apr-11 4:32
Piyush Nandanwar26-Apr-11 4:32 
GeneralRe: Open a file from path on Hyperlink click in silverlight Pin
Pete O'Hanlon26-Apr-11 4:36
mvePete O'Hanlon26-Apr-11 4:36 
GeneralRe: Open a file from path on Hyperlink click in silverlight Pin
Piyush Nandanwar26-Apr-11 4:42
Piyush Nandanwar26-Apr-11 4:42 
QuestionDATAGRID - WPF c# 2010 Pin
arkiboys25-Apr-11 21:20
arkiboys25-Apr-11 21:20 
AnswerRe: DATAGRID - WPF c# 2010 Pin
Tarun.K.S25-Apr-11 22:01
Tarun.K.S25-Apr-11 22:01 
GeneralRe: DATAGRID - WPF c# 2010 Pin
arkiboys25-Apr-11 22:41
arkiboys25-Apr-11 22:41 
GeneralRe: DATAGRID - WPF c# 2010 Pin
Wayne Gaylard25-Apr-11 22:57
professionalWayne Gaylard25-Apr-11 22:57 
GeneralRe: DATAGRID - WPF c# 2010 Pin
arkiboys25-Apr-11 23:02
arkiboys25-Apr-11 23:02 
AnswerRe: DATAGRID - WPF c# 2010 Pin
Pete O'Hanlon25-Apr-11 22:51
mvePete O'Hanlon25-Apr-11 22:51 
GeneralRe: DATAGRID - WPF c# 2010 Pin
arkiboys25-Apr-11 23:04
arkiboys25-Apr-11 23:04 
GeneralRe: DATAGRID - WPF c# 2010 Pin
Pete O'Hanlon25-Apr-11 23:36
mvePete O'Hanlon25-Apr-11 23:36 
GeneralRe: DATAGRID - WPF c# 2010 Pin
arkiboys26-Apr-11 0:08
arkiboys26-Apr-11 0:08 
GeneralRe: DATAGRID - WPF c# 2010 Pin
Pete O'Hanlon26-Apr-11 0:31
mvePete O'Hanlon26-Apr-11 0:31 
QuestionNewbie problem: laying out grid issues in silverlight Pin
Lee Reid25-Apr-11 1:31
Lee Reid25-Apr-11 1:31 
AnswerRe: Newbie problem: laying out grid issues in silverlight Pin
Pete O'Hanlon25-Apr-11 4:15
mvePete O'Hanlon25-Apr-11 4:15 
AnswerRe: Newbie problem: laying out grid issues in silverlight Pin
SledgeHammer0125-Apr-11 6:33
SledgeHammer0125-Apr-11 6:33 
GeneralRe: Newbie problem: laying out grid issues in silverlight Pin
Lee Reid25-Apr-11 14:14
Lee Reid25-Apr-11 14:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.