Click here to Skip to main content
15,886,199 members
Home / Discussions / WPF
   

WPF

 
QuestionGlobal.asax in Silverlight? Pin
devvvy12-Feb-09 4:18
devvvy12-Feb-09 4:18 
AnswerRe: Global.asax in Silverlight? Pin
Mark Salsbery12-Feb-09 5:42
Mark Salsbery12-Feb-09 5:42 
GeneralRe: Global.asax in Silverlight? Pin
devvvy12-Feb-09 14:15
devvvy12-Feb-09 14:15 
GeneralRe: Global.asax in Silverlight? Pin
Mark Salsbery12-Feb-09 14:23
Mark Salsbery12-Feb-09 14:23 
GeneralRe: Global.asax in Silverlight? Pin
devvvy13-Feb-09 21:24
devvvy13-Feb-09 21:24 
GeneralRe: Global.asax in Silverlight? Pin
Braulio Dez13-Mar-09 6:24
Braulio Dez13-Mar-09 6:24 
GeneralRe: Global.asax in Silverlight? Pin
devvvy13-Mar-09 14:33
devvvy13-Mar-09 14:33 
QuestionHow to get an Obejct from WPF ListBox?? Pin
saku6912-Feb-09 3:41
saku6912-Feb-09 3:41 
Hey,
I am trying to get an object from my WPF ListBox. I have a WPF usercontrol(ResultsControl) and it uses a Listbox(lbResults) to Display my custom Objects from a Win form. I am making a new WPF usercontrol(ShowInfoUserControl) to display my custom object's information. The showInfoUserControl should only become visible with the objects's information, when I press on an object in the WPF ListBox. I use Hyperlink to tick the showInfoUserControl. I have tried to lbResults.SelectedItem and lbResults.SelectedValue without luck. Could any one help me please? Every advice will be grateful.
my method to get my custom objects (code behind for ResultsControl)
public void GetResults(Result result)   
         {   
             WPFResult wpfResult = new WPFhResult(result.ObjectId, result.Header, result.Name);   
   
             searchResultsList.Add(wpfSearchResult);   
                   
             lbResults.ItemsSource = resultsList;               
         }

private void Windows_Loaded(object sender, RoutedEventArgs e)   
         {               
             AddHandler(Hyperlink.ClickEvent, (RoutedEventHandler)Infocard_Click);   
         }

method to call the ShowInfoUserControl
private void Infocard_Click(object sender, RoutedEventArgs e)   
        {   
            ShowInfoUserControl infocard = new ShowInfoUserControl();             
            infocard.GetInfocard((Result)lbSearchResults.SelectedValue);   
            //infocard.GetInfocard((Result)lbSearchResults.SelectedItem);   
        }

These are my code behind in ShowInfoUserControl
public void GetInfocard(Result result)   
         {   
             Header.Text = result.Header;   
             Name.Text = result.Name;   
          }

my Xaml code for ShowInfoUserControl
<UserControl x:Class="WpfResultsControl.ShowInfoUserControl"  
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
     xmlns:svc="clr-namespace:WpfResultsControl"            
     Height="200" Width="200">   
     <Grid>  
         <StackPanel>  
             <TextBlock x:Name="Header" FontFamily="Tahoma" FontSize="8"></TextBlock>  
             <TextBlock x:Name="Name" FontFamily="Tahoma" FontSize="4"></TextBlock>  
        </StackPanel>               
    </Grid>  
</UserControl>

Many thanks in advance.
AnswerRe: How to get an Obejct from WPF ListBox?? Pin
ABitSmart12-Feb-09 15:53
ABitSmart12-Feb-09 15:53 
GeneralRe: How to get an Obejct from WPF ListBox?? Pin
saku6912-Feb-09 17:42
saku6912-Feb-09 17:42 
GeneralRe: How to get an Obejct from WPF ListBox?? Pin
ABitSmart12-Feb-09 17:51
ABitSmart12-Feb-09 17:51 
GeneralRe: How to get an Obejct from WPF ListBox?? Pin
saku6913-Feb-09 2:30
saku6913-Feb-09 2:30 
GeneralRe: How to get an Obejct from WPF ListBox?? Pin
ABitSmart13-Feb-09 2:36
ABitSmart13-Feb-09 2:36 
QuestionRe: How to get an Obejct from WPF ListBox?? [modified] Pin
saku6915-Feb-09 18:07
saku6915-Feb-09 18:07 
AnswerRe: How to get an Obejct from WPF ListBox?? Pin
ABitSmart15-Feb-09 21:54
ABitSmart15-Feb-09 21:54 
QuestionPost msg. to/from MFC app.? Pin
Michael Pauli12-Feb-09 2:17
Michael Pauli12-Feb-09 2:17 
AnswerRe: Post msg. to/from MFC app.? Pin
Mark Salsbery12-Feb-09 9:30
Mark Salsbery12-Feb-09 9:30 
GeneralRe: Post msg. to/from MFC app.? [modified] Pin
sivaddrahcir18-Feb-09 9:59
sivaddrahcir18-Feb-09 9:59 
QuestionTesting Event on Custom WPF Control Pin
Jammer12-Feb-09 1:24
Jammer12-Feb-09 1:24 
AnswerRe: Testing Event on Custom WPF Control Pin
ABitSmart12-Feb-09 16:11
ABitSmart12-Feb-09 16:11 
GeneralRe: Testing Event on Custom WPF Control Pin
Jammer13-Feb-09 2:31
Jammer13-Feb-09 2:31 
GeneralRe: Testing Event on Custom WPF Control [modified] Pin
Calin Tatar13-Feb-09 5:13
Calin Tatar13-Feb-09 5:13 
GeneralRe: Testing Event on Custom WPF Control Pin
Jammer13-Feb-09 6:38
Jammer13-Feb-09 6:38 
Question[Message Deleted] Pin
S.Neela11-Feb-09 23:50
S.Neela11-Feb-09 23:50 
QuestionRe: WPF - Setting the SelectedValue in a binded combobox on loading a window or usercontrol Pin
Mark Salsbery12-Feb-09 10:15
Mark Salsbery12-Feb-09 10:15 

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.