User avatar
AdamJonsson
Topic Author
Posts: 10
Joined: 18 Jun 2019, 09:46

Double is not supported in a Windows Present

26 Aug 2019, 09:21

I'm trying to specify height as a resource in xaml.
What I found in other forums was this:
   
   <Window x:Class="MyName.WindowMobile"
        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:MyName"
        mc:Ignorable="d"
        Title="WindowMobile" Height="640" Width="320" Background="#FFF0F0F0">
   
   
    <Window.Resources>
        <sys:Double x:Key="Height">200</sys:Double>
        <sys:Double x:Key="Width">200</sys:Double>
    </Window.Resources>
However, I get this error
XDG0008 Double is not supported in a Windows Presentation Foundation (WPF) project.
XDG0008 Double is not supported in a Windows Presentation Foundation (WPF) project.
XDG0006 The namespace prefix "sys" is not defined.
XLS0414 The type 'sys:Double' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
Is this method outdated?
 
User avatar
sfernandez
Site Admin
Posts: 2997
Joined: 22 Dec 2011, 19:20

Re: Double is not supported in a Windows Present

26 Aug 2019, 11:21

You are missing the System namespace definition where Double type is declared:
xmlns:sys="clr-namespace:System;assembly=mscorlib"

Who is online

Users browsing this forum: Ahrefs [Bot] and 45 guests