inter opérabilité entre windows application form et xbap
Bonjour,
J'essaye d'intégrer un objet "DateTimePicker" créer dans une windows application form dans une application xbap.
voici le code du du fichier "page1.xaml.cs"
********************************************************
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Winforms=System.Windows.Forms;
namespace IntStat
{
/// <summary>
/// Logique d'interaction pour Page1.xaml
/// </summary>
public partial class Page1 : Page
{
public Page1()
{
InitializeComponent();
Winforms.Application.EnableVisualStyles();
// starting period date
Winforms.DateTimePicker StartingTimespicker = new System.Windows.Forms.DateTimePicker();
windowsFormsHost1.Child = StartingTimespicker;
// StartingTimespicker.ValueChanged += new EventHandler(StartingTimespicker_changed );
// Winforms.DateTimePicker EndingTimespicker = new System.Windows.Forms.DateTimePicker();
}
void StartingTimespicker_changed(object sender, EventArgs e)
{
Winforms.DateTimePicker StartingTimespicker = (Winforms.DateTimePicker)sender;
//StartingPeriodDate = StartingTimespicker.Value;
}
}
} |
**********************************************************
celui du fichier page1.xaml est :
**********************************************************
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <Page x:Class="IntStat.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Page1" Height="419" Width="762">
<Grid Height="420" Width="700">
<TreeView HorizontalAlignment="Left" Margin="9,6,0,6" Name="treeView1" Width="115" />
<ListBox Height="160" HorizontalAlignment="Left" Margin="133,6,0,0" Name="listBox1" VerticalAlignment="Top" Width="169" />
<my:WindowsFormsHost HorizontalAlignment="Left" Margin="146,206,0,182" Name="windowsFormsHost1" Width="144" xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" />
<Rectangle Margin="133,171,0,90" Name="rectangle1" Stroke="Black" HorizontalAlignment="Left" Width="169" />
<my:WindowsFormsHost Margin="146,0,0,119" Name="windowsFormsHost2" xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" HorizontalAlignment="Left" Width="144" Height="32" VerticalAlignment="Bottom" />
<Label HorizontalAlignment="Left" Margin="146,184,0,0" Name="label1" Width="98" Height="22" VerticalAlignment="Top">Période du </Label>
<Label Height="22" HorizontalAlignment="Left" Margin="146,0,0,157" Name="label2" VerticalAlignment="Bottom" Width="98">au</Label>
</Grid>
</Page> |
**********************************************************
l'erreur qui m'est renvoyée est la suivante:
*********************************************************
Citation:
System.Windows.Markup.XamlParseException was unhandled
Message: Cannot create instance of 'Page1' defined in assembly 'IntStat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'Page1.xaml' Line 1 Position 7.
*********************************************************
Est ce que l'un de vous pourrait avoir une idée?
Merci de m'aider.