Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The custom control does not apply default style while it use as root element in xaml #185

Closed
Daoting opened this issue Sep 11, 2018 · 3 comments
Labels
kind/enhancement New feature or request platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Comments

@Daoting
Copy link
Contributor

Daoting commented Sep 11, 2018

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

The custom control does not apply default style while it use as root element in xaml. When I set style by key in constructor instead of DefaultStyleKey, it's correct. The code:
public SingleWin()
{
#if UWP
DefaultStyleKey = typeof(SingleWin);
#else
Style = (Style)Application.Current.Resources["SingleWin"];
#endif
}

Expected behavior

Minimal reproduction of the problem with instructions

Environment

Nuget Package: 

Package Version(s): 
Uno.UI 1.40.0-dev.372

Affected platform(s):
- [x] iOS
- [x] Android
- [x] WebAssembly
- [ ] Windows
- [ ] Build tasks

Visual Studio
- [x] 2017 (version: )
- [ ] 2017 Preview (version: )
- [ ] for Mac (version: )

@Daoting
Copy link
Contributor Author

Daoting commented Sep 11, 2018

xaml content like this:
<dt:SingleWin
x:Class="Dt.Sample.SamplesMain"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dt="using:Dt.Base">
...
</dt:SingleWin>

code-behind:
public sealed partial class SamplesMain : SingleWin
{
public SamplesMain()
{
InitializeComponent();
}
}

@jeromelaban
Copy link
Member

Thanks for the report! DefaultStyleKey is not supported yet. it's forcibly using this.GetType() by default for now. I'll link this issue to #119.

@ghuntley ghuntley added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform kind/enhancement New feature or request labels Oct 17, 2019
@davidjohnoliver
Copy link
Contributor

Fixed by #1766

lukeblevins pushed a commit to lukeblevins/uno that referenced this issue Jan 17, 2024
…kages

Added System.Text.Encondings.Web explicitly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform
Projects
None yet
Development

No branches or pull requests

4 participants