[Solved] Unable to parse XAML/XML

I found that the XAML content that I read from the file contained BOM. I BOM is stripped out, the XAML code is parsable. I use Visual Studio 2010. The “Text Visualizer” in debugging mode did not show any sign of BOM (the XAML string is in UTF8). But when I accidently copied the text … Read more

[Solved] Unable to Render ContentControl inside Window [closed]

Set the DataContext property of the window: <Window x:Class=”MimicView.MainWindow” xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” xmlns:d=”http://schemas.microsoft.com/expression/blend/2008″ xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″ xmlns:local=”clr-namespace:MimicView” mc:Ignorable=”d” d:DataContext=”{d:DesignInstance local:MainWindowViewModel}” Title=”MainWindow” Height=”350″ Width=”525″> <Window.Resources> <DataTemplate DataType=”{x:Type local:ViewModel1}”> <local:View1/> </DataTemplate> </Window.Resources> <Window.DataContext> <local:MainWindowViewModel /> </Window.DataContext> <Grid> <ContentControl Content=”{Binding viewModel1}”></ContentControl> </Grid> </Window> This only sets the design time DataContext: d:DataContext=”{d:DesignInstance local:MainWindowViewModel}” You should also set the actual DataContext property: <Window.DataContext> … Read more

[Solved] Value’s Not Appearing In Datagrid? [closed]

Ahhh, At last I found solution to it. instead of declaring properties private they should be public:- private string ProductName { get; set; } private string ProductPrice { get; set; } private string ProductUnit { get; set; } private string ProductStock { get; set; } Correction:- public string ProductName { get; set; } public string … Read more

[Solved] What is the used for in Xamarin Forms and can it be replaced with a value setting?

Using the new syntax, that would translate to: <Grid ColumnDefinitions=”*, 50″> For the complete specs on the new syntax, you can read this: https://github.com/microsoft/microsoft-ui-xaml/issues/673 Basically, <ColumnDefinition /> is the equivalent of <ColumnDefinition Width=”*” /> (* is the default value for the Width property). The width of a column can be expressed in 3 ways: Auto … Read more

[Solved] WPF creating grid from XAML in code-behind

You can do that by making your “existing grid” a separate UserControl. First, you need to add a UserControl via [Add]->[User Control…]->[User Control (WPF)]. Next, put your “existing grid” inside the added UserControl. YourExistingGridControl.xaml <UserControl x:Class=”Your.Namespace.YourExistingGridControl”> <Grid> … YOUR EMPTY GRID WITH ALL THE COLUMNS, ETC. … </Grid> </UserControl> Now, you can create as many … Read more

[Solved] Enable MVVM object only if three other MVVM objects are already enable

you could use this: //Button B private bool _enableButtonB; public bool EnableButtonB { get { return _enableButtonB; } set { _enableButtonB = value; OnPropertyChanged(“EnableButtonB”); EnableButtonA=value; } } private bool _enableButtonC; public bool EnableButtonC { get { return _enableButtonC; } set { _enableButtonC = value; OnPropertyChanged(“EnableButtonC”); EnableButtonA=value; } } //Button D private bool _enableButtonD; public bool … Read more

[Solved] overriding ToString() method, behaves strange with Binding

<DataGridTextColumn Header=”Name” Binding=”{Binding Path=Name,Mode=TwoWay}” /> DataGridTextColumn takes a CellContent instance and calls ToString() to display it. It displays Value, but without .Value in the path edits in datagrid cells are not applied. <DataTrigger Binding=”{Binding IsTrend}” Value=”True” > DataTrigger takes a CellContent instance and calls Equals() with parameter “True”. But CellContent object is not equal to … Read more

[Solved] when swiping from bottom of screen, taskbar should be visible – UWP [closed]

when swiping from bottom of screen, taskbar should be visible – UWP For your requirement, you need detect the taskbar‘s ManipulationDelta event, and if Cumulative.Translation.Y more than your threshold then invoke double animation to move taskbar down or up. For example private bool _isSwiped; private void StackPanel_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e) { if (e.IsInertial && !_isSwiped) … Read more