I get the following error when trying to bind a simple Xaml TextBlock object to C#:
Error Message: "Exception Unhandled: 'Microsoft.ui.xaml.dll' or one of its dependecies: The specified module could not be found. (0x8007007E)"
The App.g.i.cs file brought up highlights 'XamlCheckProcessRequirements();' in its code. I'm using Visual Studio to bind a xaml object to a data-type returned by a simple function 'View1'. Here is what I have coded so far:
Xaml Code:
C# Code:
I tried instantiating the class for the binding context as shown with 'ViewModel1 viewModel1 = new ViewModel1();'. I would like to get the data-type value imported as the value for the 'Text' property in 'TextBlock' as shown in the xaml code above. I would like to know why the binding code is throwing an exception.
Error Message: "Exception Unhandled: 'Microsoft.ui.xaml.dll' or one of its dependecies: The specified module could not be found. (0x8007007E)"
The App.g.i.cs file brought up highlights 'XamlCheckProcessRequirements();' in its code. I'm using Visual Studio to bind a xaml object to a data-type returned by a simple function 'View1'. Here is what I have coded so far:
Xaml Code:
Code:
<Grid Width="Auto" Height="Auto" Background="#1f1f1f">
<TextBlock Text="{Binding View1}"></TextBlock>
</Grid>
C# Code:
Code:
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
namespace drawing_board
{
public sealed partial class MainWindow : Window
{
public MainWindow()
{
this.InitializeComponent();
}
ViewModel1 viewModel1 = new ViewModel1();
class ViewModel1
{
public static double View1()
{
double num1 = 321;
double num2 = 654;
double sum = num1 + num2;
return sum;
}
}
}
}
I tried instantiating the class for the binding context as shown with 'ViewModel1 viewModel1 = new ViewModel1();'. I would like to get the data-type value imported as the value for the 'Text' property in 'TextBlock' as shown in the xaml code above. I would like to know why the binding code is throwing an exception.