Forums

UI Generator - ekUIGen
Last Post 28 Feb 2016 06:33 AM by Stanislav Pitsul. 8 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Filip DušekUser is Offline
Advanced Member
Advanced Member
Posts:676


--
12 Aug 2014 12:16 PM
    UI Generator is finally out as open source. You can find it on GitHub - http://github.com/EmptyKeys/UI_Generator
    If you have any feedback pls post here.

    Few notes for Generator assembly:

    If you want to implement new control in generator you have to implement IGeneratorType interface. It's easier if base class of your control is some of the existing controls in library. In that case you can use base class in generator. For example if you create new specialized TextBox, you can use TextBoxGeneratorType as base for your generator class. Don't forget add your generator type to Generators collection of TypeGenerator class.

    Resource Dictionary and some parts of type generator are using Value Generator and IGeneratorValue. This interface (and ValueGenerator) is usefull if you want generate some special value (let's say some custom data in resource dictionary).

    Designer assembly is useful if you have some new control (or some feature), which is not normally supported by WPF XAML. You can implement designer stuff there.

    UI Generator return codes
    -1 : wrong arguments
    -2 : error during code generation
    -3 : error during image asset copy (wrong target directory, missing files)

    See Output in Visual Studio for detailed info.
    Filip DušekUser is Offline
    Advanced Member
    Advanced Member
    Posts:676


    --
    12 Oct 2015 01:17 PM
    There is new UI Generator NuGet package - http://www.nuget.org/packages/Empty...Generator/

    You can use it from post-build step. Example:

    CD "$(SolutionDir)packages\EmptyKeysUI_Generator*\tools"
    
    ekUIGen.exe -i="$(ProjectDir)\" -o="$(ProjectDir)..\GameUILibrary\GeneratedUI" -oa="$(ProjectDir)..\Content" -bd="$(TargetDir)\"
    


    There is new "bd" command line options, which is handy if you need build of the user interface in generator directory (for example another assembly with custom user controls etc.) . It will copy build result.
    Aravol AmakiirUser is Offline
    New Member
    New Member
    Posts:1


    --
    24 Oct 2015 04:53 PM
    Where can we find documentation on the generator and arguments it accepts?
    Filip DušekUser is Offline
    Advanced Member
    Advanced Member
    Posts:676


    --
    24 Oct 2015 05:08 PM
    Type in command line: ekUiGen.exe /help
    Stanislav PitsulUser is Offline
    New Member
    New Member
    Posts:10


    --
    27 Feb 2016 04:20 PM
    Such XAML:
    <Setter Property="Control.Margin" Value="15" /> 

    generates:
    new Setter(FrameworkElement.MarginProperty, new Thickness(15F)) 

    which produces the error:
    CS0103 The name 'FrameworkElement' does not exist in the current context

    Manually replacing by Control or UIElement works well except it's manual way.
    Filip DušekUser is Offline
    Advanced Member
    Advanced Member
    Posts:676


    --
    27 Feb 2016 04:48 PM
    Can you post complete Style?
    Stanislav PitsulUser is Offline
    New Member
    New Member
    Posts:10


    --
    27 Feb 2016 06:46 PM
    <Style x:Key="ControlStyle">
    	<Setter Property="TextBlock.Foreground" Value="Gray" />
    	<Setter Property="TextBlock.FontSize" Value="30" />
    	<Setter Property="Control.Margin" Value="15" />
    </Style>
     
    Filip DušekUser is Offline
    Advanced Member
    Advanced Member
    Posts:676


    --
    28 Feb 2016 12:39 AM
    You can do this for now
     
    <Style x:Key="ControlStyle" TargetType="{x:Type TextBlock}"> ...
     


    I will fix the problem, when there is no target type.
    Stanislav PitsulUser is Offline
    New Member
    New Member
    Posts:10


    --
    28 Feb 2016 06:33 AM

    I will fix the problem, when there is no target type.



    Thank you.
    Also, I can't use target type because I want apply the style to the Buttons too otherwise I would used it initially to avoid type specification for each property. But it isn't a problem, until you can fix it I will happy to use two separate styles.
    You are not authorized to post a reply.