小编The*_*Spy的帖子

WPF XAML Parse异常发生错误?

 <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            x:Class="AFICController.EULA"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:res="clr-namespace:AFICController.Resources"
            Title="{x:Static res:Strings.WizardWelcomeWindow_Title}"
            Width="800"
            Height="600"  
            WindowStartupLocation="CenterScreen"
            Icon="/AFICController;Component/Resources/Images/att_icon.ico"
            ResizeMode="NoResize">
Run Code Online (Sandbox Code Playgroud)

我正在开发一个C#WPF Applcation我正在使用MVVM实现它.我的应用程序首先显示启动画面,看起来不错,但之后我想要EULA(最终用户许可协议)窗口,当我尝试执行它时显示异常为"XAML解析异常"在'System.Windows.Markup.StaticExtension'上提供值"通过定位上面的代码引发异常.

以下是我调用EULA的C#代码.请帮助我,因为我已经尝试了所有方法来删除此异常.

class App : Application
{
[STAThread()]
static void Main()
{
  Splasher.Splash = new SplashScreen();
  Splasher.ShowSplash();

  Mouse.OverrideCursor = null;

  for (int i = 0; i < 5000; i++)
  {
    Thread.Sleep(1);
  }

  Splasher.CloseSplash();
  new App();
}
/// <summary>
/// 
/// </summary>
public App()
{

  App.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new       Uri(@"\Resources\Dictionary\ATTColors.xaml", UriKind.Relative) });

  App.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri(@"\Resources\Dictionary\AppButton.xaml", UriKind.Relative) });

  Console.WriteLine("EULA Opened");
  StartupUri = new …
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml mvvm

6
推荐指数
1
解决办法
5791
查看次数

为什么在C程序中从main()返回0?

在编写C/C++程序时,特别是最新的编译器,为什么我们需要从main()方法返回一个整数?像int main()一样,我们从它返回"return 0".那背后的确切原因是什么?

c c++

5
推荐指数
3
解决办法
1万
查看次数

INotifyPropertyChange接口错误

public class ViewModel : INotifyPropertyChanged
{
    private string name;
    public string Name
    {
        get
        {
            return name;
        }
        set
        {
            if (name != value)
            {
                name = value;
                OnPropertyChanged("Name");

            }
        }
    }
    protected void OnPropertyChanged(string propertyname)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(propertyname));
        }
    }
    public PropertyChangedEventHandler PropertyChanged;
}

public partial class MainWindow : Window
{
    private ViewModel vm;
    public MainWindow()
    {
        InitializeComponent();
        vm = new ViewModel { Name = "Shahrukh Khan" };
        DataContext = vm;
    }

    private …
Run Code Online (Sandbox Code Playgroud)

c# inotifypropertychanged

1
推荐指数
1
解决办法
2038
查看次数

使用未初始化的局部变量'num'?

#include<stdio.h>
#include<conio.h>

int main()
{
    int num;
    printf("Enter your number \n");
    scanf_s("%d", num);
    printf("Your number is %d", num);
    _getch();
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

当我在VS2013中构建上述代码时,它给出了以下错误:

错误C4700:未初始化的局部变量'num'使用?? 这是什么原因?

c visual-studio-2013

0
推荐指数
1
解决办法
2237
查看次数

标签 统计

c ×2

c# ×2

c++ ×1

inotifypropertychanged ×1

mvvm ×1

visual-studio-2013 ×1

wpf ×1

xaml ×1