Я создал приложение wpf, но при изменении объекта запуска возникла проблема. Я хочу изменить его на xaml
в раскрывающемся списке свойств запуска объекта, там нет файла xaml.Сначала я снял флажок включения фреймворка и нажал опцию submain, я добавляю код, но все равно есть ошибка "нет подосновы в wpf1"
Public Shared Sub Main()
Dim app As Application = New Application()
app.InitializeComponent()
app.Run()
End Sub
Namespace wpf1
'''<summary>
'''Application
'''</summary>
<Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Public Class Application
Inherits System.Windows.Application
Implements System.Windows.Markup.IComponentConnector
Private _contentLoaded As Boolean
'''<summary>
'''InitializeComponent
'''</summary>
<System.Diagnostics.DebuggerNonUserCodeAttribute(),
System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")>
Public Sub InitializeComponent() Implements System.Windows.Markup.IComponentConnector.InitializeComponent
If _contentLoaded Then
Return
End If
_contentLoaded = True
Dim resourceLocater As System.Uri = New System.Uri("/wpf1;component/application.xaml", System.UriKind.Relative)
#ExternalSource ("..\..\Application.xaml", 1)
System.Windows.Application.LoadComponent(Me, resourceLocater)
#End ExternalSource
End Sub
<System.Diagnostics.DebuggerNonUserCodeAttribute(), _
System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0"), _
System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never), _
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes"), _
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity"), _
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")> _
Sub System_Windows_Markup_IComponentConnector_Connect(ByVal connectionId As Integer, ByVal target As Object) Implements System.Windows.Markup.IComponentConnector.Connect
Me._contentLoaded = true
End Sub
End Class
End Namespace
это приложение. xaml
<Application x:Class="wpf1.Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:wpf1"
>
<Application.Resources>
</Application.Resources>
</Application>
и class application.vb
Class Application
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
' can be handled in this file.
Public Shared Sub Main()
Dim app As Application = New Application()
app.InitializeComponent()
app.Run(login)
End Sub
End Class
Я также пытался удалить startupuri, но безрезультатно, как я могу изменить объект запуска на xaml?