Top Index
Yahooは検索方式が変わったせいか、うまくサイト内検索できないなぁ。つーわけでグーグルに変更。
![]() ![]() ![]() |
<Application x:Class="Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<Application.Resources>
</Application.Resources>
</Application>
Class Application
Private _view As Window
Private Sub Application_Startup(ByVal sender As Object, ByVal e As System.Windows.StartupEventArgs) Handles Me.Startup
_view = New Window1 '大元になるウインドウをインスタンス
_view.Show() 'ビューを開く
End Sub
End Class
Public Class SampleViewModel
Public Sub New()
Me.Comment = "ViewModelです"
End Sub
Private _comment As String
Public Property Comment() As String
Get
Return _comment
End Get
Set(ByVal value As String)
_comment = value
End Set
End Property
End Class
Class Application
Private _view As Window
Private Sub Application_Startup(ByVal sender As Object, ByVal e As System.Windows.StartupEventArgs) Handles Me.Startup
_view = New Window1 '大元になるウインドウをインスタンス
_view.DataContext = New SampleViewModel 'ViewModelをインスタンスし、Viewと関連付けする
_view.Show() 'ビューを開く
End Sub
End Class
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="{Binding Comment}" Height="300" Width="300">
<Grid>
</Grid>
</Window>