Note that there are some explanatory texts on larger screens.

plurals
  1. POWINRT XAML System.Void Compile Error in
    primarykey
    data
    text
    <p>after a little code change inside a Store App I ran into a compilation error:</p> <p>-> System.Void cannot be used from C# -- use typeof(void) to get the void type object.</p> <p>Problem is: this comes from a generated file: XamlTypeInfo.g.cs.</p> <pre><code>case "System.Void" userType= new ... ,typeof(global::System.Void), ... ... </code></pre> <p>Rolling back the changes did not help, as deleting bin &amp; obj, restarting, etc.</p> <p>Is the actual System.Void case entry maybe an indicator that something within a XAML file could not be recognized by the code generator? Is there an System.Void entry in a working XamlTypeInfo.g.cs?</p> <p>--- ADDITION --- I can now produce the compile error when changing specific lines. I have a custom control deriving from ItemsControl. I define a regular DP which works fine. I am also providing AttachedProperties for Template, TemplateSelector and Style. Think of a Textbox that gets an Label via an AttachedProperty and its not just a string but like HeaderedControls you can define a Template etc. for the Lable.</p> <p>The Problem is related to the Get/Set Methods for the AttachedProp. When I either change the Getter return type to DataTemplate or I comment out the Setter fully then the compile error comes:</p> <pre><code>public static DataTemplate GetLabelTEmplate(UIElement element) { return (DataTemplate)element.GetValue(LabelTemplateProperty; } public static void SetLabelTemplate(UIElement element, object value) { element.SetValue(LabelTemplateProperty, value); } </code></pre> <p>Any ideas would be highly appreciated.</p> <p>Best regards Gope</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload