benruehl / adonis-ui

Lightweight UI toolkit for WPF applications offering classic but enhanced windows visuals
https://benruehl.github.io/adonis-ui/
MIT License
1.73k stars 145 forks source link

Harmless exception is thrown for textboxes (Related to Watermark) #88

Closed micah686 closed 4 years ago

micah686 commented 4 years ago

Describe the bug An exception is thrown when a textbox is present: Exception thrown: 'MS.Internal.Xaml.Parser.GenericTypeNameParser.TypeNameParserException' in System.Xaml.dll

To Reproduce If you add a textbox to the control, the output window will give an exception

Expected behavior There should not be an exception

Screenshots If applicable, add screenshots to help explain your problem.

Additional context I have the following code:

xmlns:adonisExtensions="clr-namespace:AdonisUI.Extensions;assembly=AdonisUI"
....

<Grid.Resources>
    <Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
         <Style.Triggers>
               <DataTrigger Binding="{Binding Path=(adonisExtensions:WatermarkExtension.IsWatermarkVisible)}"/>
         </Style.Triggers>
     </Style>
</Grid.Resources>
.....
<Grid>
   <Textbox Text={Binding PropertyName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" adonisExtensions:WatermarkExtension.Watermark="" adonisExtensions:WatermarkExtension.IsWatermarkVisible="False"/>
</Grid>

While this does eliminate the watermark issue noted in #18 , the exception mart still occurs.

benruehl commented 4 years ago

I'm afraid I cannot reproduce this. I created a new project and added only Adonis UI and the XAML code you provided. The app runs fine and the output window only shows 2 errors. Those errors are for the 2 bindings which is expected here.

Do you have a link to your project maybe so I can test it there?

You could also try to deactivate the XAML Designer and see if it is the source of the error.

micah686 commented 4 years ago

So, it seems like it's a bug with version 1.14.0 and below, but version 1.15.0 fixes it. Interestingly, it also removed the text about the watermark, even though I hadn't used the adonis extension to set the watermark visibility to false, and set the watermark text to an empty string. I'll leave it up to you if you want to look into why 15.0 had the issue, or just close the issue, since it seems to be resolved.

Sample_With_error_1.14.0.zip

benruehl commented 4 years ago

Hm, weird. I don't think anything changed in v1.15 regarding the watermarks. But I'm glad it disappeared for you :) I will close this issue then. You can reopen it in case it reappears again.