Click here to Skip to main content
15,910,980 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Silverlight SDK Pin
CrazyCoder2614-Sep-09 21:02
CrazyCoder2614-Sep-09 21:02 
GeneralRe: Silverlight SDK Pin
Arun Jacob15-Sep-09 1:53
Arun Jacob15-Sep-09 1:53 
Questiondatabase connectivity Pin
Aryan198214-Sep-09 12:26
Aryan198214-Sep-09 12:26 
AnswerRe: database connectivity Pin
Arun Jacob14-Sep-09 18:43
Arun Jacob14-Sep-09 18:43 
Questionsilverlight Pin
Aryan198214-Sep-09 12:19
Aryan198214-Sep-09 12:19 
AnswerRe: silverlight Pin
Mark Salsbery15-Sep-09 5:08
Mark Salsbery15-Sep-09 5:08 
QuestionListBox displaying of items problem Pin
Zammy_bg14-Sep-09 4:00
Zammy_bg14-Sep-09 4:00 
AnswerRe: ListBox displaying of items problem Pin
Pete O'Hanlon14-Sep-09 4:42
mvePete O'Hanlon14-Sep-09 4:42 
It's not a bug. You need to supply a template that tells the listbox what to display. Off the top of my head, this is what you'd expect to put into the XAML:
<Window
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2006" 
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
  x:Class="GameSampleApp.Window1"
  x:Name="Window"
  Title="Sample App"
  Width="380" Height="240">
  <Window.Resources>
    <Style TargetType="ListBox">
      <Setter Property="Control.FontFamily" Value="Tahoma" />
      <Setter Property="Control.FontSize" Value="10" />
    </Style>
    <Style x:Key="FontStyle">
      <Setter Property="Control.FontFamily" Value="Verdana" />
      <Setter Property="Control.FontStyle" Value="Italic" />
      <Setter Property="Control.FontSize" Value="12"/>
    </Style>
    <DataTemplate x:Key="GamePersonTemplate">
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition/>
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
        <ColumnDefinition/>
      </Grid.ColumnDefinitions>
      <TextBlock Width="40" Grid.Column="0" 
         Text="{Binding Name, Mode=OneWay}" />
    </Grid>
    </DataTemplate>
  </Window.Resources>
  <Grid x:Name="LayoutRoot">
    <ListBox Padding="3" HorizontalAlignment="Left" Width="Auto" 
      ItemTemplate="{DynamicResource GamePersonTemplate}" 
      ItemsSource="{Binding}" VerticalAlignment="Top" Height="Auto"/>
  </Grid>
</Window>
You'll obviously need to hook your GameObject into the DataContext.

"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



GeneralRe: ListBox displaying of items problem Pin
Richard MacCutchan14-Sep-09 21:43
mveRichard MacCutchan14-Sep-09 21:43 
GeneralRe: ListBox displaying of items problem Pin
Pete O'Hanlon14-Sep-09 22:59
mvePete O'Hanlon14-Sep-09 22:59 
Questionidea/help in designing forum Pin
hrishiS14-Sep-09 1:14
hrishiS14-Sep-09 1:14 
AnswerRe: idea/help in designing forum Pin
Michael Sync14-Sep-09 1:54
Michael Sync14-Sep-09 1:54 
QuestionDynamically change the location of controls in silverlight Pin
Nekkantidivya13-Sep-09 20:36
Nekkantidivya13-Sep-09 20:36 
QuestionWPF animations hardware requirements Pin
koleraba13-Sep-09 11:12
koleraba13-Sep-09 11:12 
AnswerRe: WPF animations hardware requirements Pin
Christian Graus13-Sep-09 13:51
protectorChristian Graus13-Sep-09 13:51 
AnswerRe: WPF animations hardware requirements Pin
Mark Salsbery14-Sep-09 10:35
Mark Salsbery14-Sep-09 10:35 
QuestionCan I use excel spreadsheet as a datagrid In a WPF Client? Pin
bgundas12-Sep-09 12:08
bgundas12-Sep-09 12:08 
QuestionDyanmically assign source to a Medial element. Pin
Nekkantidivya12-Sep-09 2:01
Nekkantidivya12-Sep-09 2:01 
AnswerRe: Dyanmically assign source to a Medial element. Pin
Mark Salsbery12-Sep-09 7:14
Mark Salsbery12-Sep-09 7:14 
QuestionGetting ObservableCollection ThreadSafe Pin
ezazazel11-Sep-09 4:35
ezazazel11-Sep-09 4:35 
AnswerRe: Getting ObservableCollection ThreadSafe Pin
Pete O'Hanlon11-Sep-09 4:40
mvePete O'Hanlon11-Sep-09 4:40 
GeneralRe: Getting ObservableCollection ThreadSafe Pin
ezazazel11-Sep-09 5:08
ezazazel11-Sep-09 5:08 
QuestionSave the video from the Openfile dialog to a folder Pin
Nekkantidivya11-Sep-09 2:49
Nekkantidivya11-Sep-09 2:49 
QuestionUpload and display videos Pin
Nekkantidivya10-Sep-09 19:03
Nekkantidivya10-Sep-09 19:03 
AnswerRe: Upload and display videos Pin
Mark Salsbery11-Sep-09 6:31
Mark Salsbery11-Sep-09 6:31 

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.