Click here to Skip to main content
16,014,650 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Databinding a ListBox using MVVM light (Windows Phone) Pin
AlphaDeltaTheta20-May-13 15:08
AlphaDeltaTheta20-May-13 15:08 
QuestionWPF datagrid text alignment in columns Pin
elelont216-May-13 23:53
elelont216-May-13 23:53 
AnswerRe: WPF datagrid text alignment in columns Pin
Pete O'Hanlon17-May-13 0:33
mvePete O'Hanlon17-May-13 0:33 
GeneralRe: WPF datagrid text alignment in columns Pin
elelont217-May-13 2:16
elelont217-May-13 2:16 
GeneralRe: WPF datagrid text alignment in columns Pin
Pete O'Hanlon17-May-13 2:31
mvePete O'Hanlon17-May-13 2:31 
QuestionNew Table to an existing Silverlight project Pin
picasso216-May-13 19:36
picasso216-May-13 19:36 
QuestionWPF motion path animation on controls Pin
usmankai16-May-13 14:10
usmankai16-May-13 14:10 
QuestionMust compile XAML file that specifies events Pin
Neo1010115-May-13 23:29
Neo1010115-May-13 23:29 
When working with a XAML file in conjunction with JavaScript and HTML in VisualStudio, whenever I try to set the Loaded attribute in my Grid, my XAML page will fail to load. I get a blank screen and when I right click somewhere in the page, I see a little box saying 'Silverlight'. The JavaScript will also fail to execute.

I get the following message when I try to open the page in Internet Explorer: "Must compile XAML that specifies events".

Surprisingly, the other XAML page (Speeds.xaml) I have does not fail to execute the JS nor the XAML. It runs properly.

Failing XAML file (Accuracy.xaml):
XML
<?xml version="1.0" encoding="UTF-8"?>
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      
      Loaded="onLoaded">
  <Grid.RowDefinitions>
    <RowDefinition Height="20*" />
    <RowDefinition Height="60*" />
    <RowDefinition Height="20*" />
  </Grid.RowDefinitions>
  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="20*" />
    <ColumnDefinition Width="60*" />
    <ColumnDefinition Width="20*" />
  </Grid.ColumnDefinitions>
  <Grid.Background>
    <LinearGradientBrush>
      <GradientStop Color="#FF3B596E" />
      <GradientStop Color="#FF93C5E8" Offset="1" />
    </LinearGradientBrush>
  </Grid.Background>
  <Canvas Grid.Row="1" Grid.Column="1">
    <Canvas.Background>
      <LinearGradientBrush>
        <GradientStop Color="#FF93C5E8" />
        <GradientStop Color="#FF3B596E" Offset="1" />
      </LinearGradientBrush>
    </Canvas.Background>
    <TextBlock Foreground="Ivory" FontSize="16" Canvas.Left="369.68" Canvas.Top="22.29017076">Accuracy</TextBlock>
    
    <Border Width="103.03999999999999" Canvas.Left="103.03999999999999" Canvas.Top="75.76162307999999" BorderThickness="2" BorderBrush="Red" Height="26.73572616">
      <TextBlock Text="Sum 1-20" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Border>
    <Border Width="103.03999999999999" Canvas.Left="357.6" Canvas.Top="75.76162307999999" BorderThickness="2" BorderBrush="Red" Height="26.73572616">
      <TextBlock Text="Sum 21-40" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Border>
    <Border Width="103.03999999999999" Canvas.Left="612.1600000000001" Canvas.Top="75.76162307999999" BorderThickness="2" BorderBrush="Red" Height="26.73572616">
      <TextBlock Text="Sum 41-60" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Border>
    <Line X1="48.480000000000004" Y1="154.9844" X2="758.24" Y2="154.9844" StrokeThickness="2" Stroke="Red" />
    <Line X1="48.480000000000004" Y1="154.9844" X2="48.480000000000004" Y2="333.6304" StrokeThickness="2" Stroke="Red" />
    <Line X1="48.480000000000004" Y1="200.5612596" X2="758.24" Y2="200.5612596" StrokeThickness="1" Stroke="Red" />
    <Line X1="48.480000000000004" Y1="245.1381192" X2="758.24" Y2="245.1381192" StrokeThickness="1" Stroke="Red" />
    <Line X1="48.480000000000004" Y1="289.7149788" X2="758.24" Y2="289.7149788" StrokeThickness="1" Stroke="Red" />
    <Line X1="48.480000000000004" Y1="334.29183839999996" X2="758.24" Y2="334.29183839999996" StrokeThickness="1" Stroke="Red" />
    <Border Canvas.Left="24.240000000000002" Canvas.Top="148.42759999999998" Width="15" HorizontalAlignment="Center">
      <TextBlock Text="0" Foreground="Ivory" HorizontalAlignment="Center" />
    </Border>
    <Border Canvas.Left="24.240000000000002" Canvas.Top="193.0044596" Width="15" HorizontalAlignment="Center">
      <TextBlock Text="5" Foreground="Ivory" HorizontalAlignment="Center" />
    </Border>
    <Border Canvas.Left="24.240000000000002" Canvas.Top="237.5813192" Width="15" HorizontalAlignment="Center">
      <TextBlock Text="10" Foreground="Ivory" HorizontalAlignment="Center" />
    </Border>
    <Border Canvas.Left="24.240000000000002" Canvas.Top="282.1581788" Width="15" HorizontalAlignment="Center">
      <TextBlock Text="15" Foreground="Ivory" HorizontalAlignment="Center" />
    </Border>
    <Border Canvas.Left="24.240000000000002" Canvas.Top="326.73503839999995" Width="15" HorizontalAlignment="Center">
      <TextBlock Text="20" Foreground="Ivory" HorizontalAlignment="Center" />
    </Border>
    <Border Canvas.Left="96.88" Canvas.Top="154.9844" Border.Background="#FF0093DD" Width="30.320000000000004" Height="116.1199" Visibility="Collapsed" x:Name="bar0" MouseLeftButtonUp="test">
      <TextBlock Text="13" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
    </Border>
        <Border Canvas.Left="145.35999999999999" Canvas.Top="154.9844" Border.Background="#FF29166F" Width="30.320000000000004" Height="35.7292" Visibility="Collapsed" x:Name="bar1" MouseLeftButtonUp="test">
      <TextBlock Text="4" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
    </Border>
        <Border Canvas.Left="193.84" Canvas.Top="154.9844" Border.Background="#FF830F0F" Width="30.320000000000004" Height="26.7969" Visibility="Collapsed" x:Name="bar2" MouseLeftButtonUp="test">
      <TextBlock Text="3" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
    </Border>
        <Border Canvas.Left="345.36" Canvas.Top="154.9844" Border.Background="#FF0093DD" Width="30.320000000000004" Height="53.5938" Visibility="Collapsed" x:Name="bar3" MouseLeftButtonUp="test">
      <TextBlock Text="6" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
    </Border>
        <Border Canvas.Left="393.84000000000003" Canvas.Top="154.9844" Border.Background="#FF29166F" Width="30.320000000000004" Height="80.3907" Visibility="Collapsed" x:Name="bar4" MouseLeftButtonUp="test">
      <TextBlock Text="9" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
    </Border>
        <Border Canvas.Left="442.32" Canvas.Top="154.9844" Border.Background="#FF830F0F" Width="30.320000000000004" Height="44.6615" Visibility="Collapsed" x:Name="bar5" MouseLeftButtonUp="test">
      <TextBlock Text="5" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
    </Border>
        <Border Canvas.Left="593.84" Canvas.Top="154.9844" Border.Background="#FF0093DD" Width="30.320000000000004" Height="107.1876" Visibility="Collapsed" x:Name="bar6" MouseLeftButtonUp="test">
      <TextBlock Text="12" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
    </Border>
        <Border Canvas.Left="642.32" Canvas.Top="154.9844" Border.Background="#FF29166F" Width="30.320000000000004" Height="26.7969" Visibility="Collapsed" x:Name="bar7" MouseLeftButtonUp="test">
      <TextBlock Text="3" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
    </Border>
        <Border Canvas.Left="690.8000000000001" Canvas.Top="154.9844" Border.Background="#FF830F0F" Width="30.320000000000004" Height="44.6615" Visibility="Collapsed" x:Name="bar8" MouseLeftButtonUp="test">
      <TextBlock Text="5" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
    </Border>
    <Border Canvas.Left="96.96000000000001" Canvas.Top="378.87690204" Border.Background="#FF0093DD" Width="200.0" Height="31.19970204">
      <TextBlock Text="N° of correct responses" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Border>
    <Border Canvas.Left="296.96000000000004" Canvas.Top="378.87690204" Border.Background="#FF29166F" Width="200.0" Height="31.19970204">
      <TextBlock Text="N° of incorrect responses" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Border>
    <Border Canvas.Left="496.96000000000004" Canvas.Top="378.87690204" Border.Background="#FF830F0F" Width="200.0" Height="31.19970204">
      <TextBlock Text="N° of no responses" Foreground="Ivory" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Border>
  </Canvas>
</Grid>


Working XAML (Speeds.xaml):
XML
<?xml version="1.0" encoding="UTF-8"?>
<Grid
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Loaded="onLoaded">
</Grid>


Why is this happening and how can I fix this?

modified 16-May-13 5:42am.

AnswerRe: Must compile XAML file that specifies events Pin
AlphaDeltaTheta18-May-13 16:42
AlphaDeltaTheta18-May-13 16:42 
GeneralRe: Must compile XAML file that specifies events Pin
Neo1010119-May-13 4:23
Neo1010119-May-13 4:23 
GeneralRe: Must compile XAML file that specifies events Pin
AlphaDeltaTheta19-May-13 14:48
AlphaDeltaTheta19-May-13 14:48 
QuestionIs Frame is a good Control for loading a Xaml page in WPF? Pin
Mohammed Hameed14-May-13 19:53
professionalMohammed Hameed14-May-13 19:53 
AnswerRe: Is Frame is a good Control for loading a Xaml page in WPF? Pin
Abhinav S15-May-13 8:12
Abhinav S15-May-13 8:12 
GeneralRe: Is Frame is a good Control for loading a Xaml page in WPF? Pin
Mohammed Hameed15-May-13 19:28
professionalMohammed Hameed15-May-13 19:28 
QuestionTreeViewDragDropTarget Drag Certain Node Only Pin
Member 1003315714-May-13 19:52
Member 1003315714-May-13 19:52 
QuestionWPF / MVVM Get Data From ViewModel Pin
Kevin Marois14-May-13 15:10
professionalKevin Marois14-May-13 15:10 
AnswerRe: WPF / MVVM Get Data From ViewModel Pin
SledgeHammer0115-May-13 6:57
SledgeHammer0115-May-13 6:57 
GeneralRe: WPF / MVVM Get Data From ViewModel Pin
Kevin Marois15-May-13 7:54
professionalKevin Marois15-May-13 7:54 
GeneralRe: WPF / MVVM Get Data From ViewModel Pin
SledgeHammer0115-May-13 8:41
SledgeHammer0115-May-13 8:41 
GeneralRe: WPF / MVVM Get Data From ViewModel Pin
Kevin Marois15-May-13 9:00
professionalKevin Marois15-May-13 9:00 
GeneralRe: WPF / MVVM Get Data From ViewModel Pin
Kevin Marois20-May-13 14:00
professionalKevin Marois20-May-13 14:00 
GeneralRe: WPF / MVVM Get Data From ViewModel Pin
SledgeHammer0120-May-13 16:16
SledgeHammer0120-May-13 16:16 
GeneralRe: WPF / MVVM Get Data From ViewModel Pin
Kevin Marois15-Jun-13 10:37
professionalKevin Marois15-Jun-13 10:37 
Questionweb services Pin
picasso212-May-13 12:54
picasso212-May-13 12:54 
AnswerRe: web services Pin
Abhinav S12-May-13 18:29
Abhinav S12-May-13 18:29 

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.