You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2024. It is now read-only.
This is more of a question than a bug report, I'm sorry if this isn't the right place to post it.
I wanted to separate my Xamarin app styling to a separate class library so it can be reused in other apps (light and dark theme, control styles, etc). However, the issue I'm running into is that when the class library is installed (via private nuget feed) and used in Xamarin apps, the Intellisense doesn't work for any of the color resources (it works for styles).
Is there a way to fix this? How can I tell my class library that the ResourceDictionaries it contains need to be present at design time for Intellisense to work?
<?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionaryx:Class="MyMobileThemes.LightTheme"xmlns="http://xamarin.com/schemas/2014/forms"xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Colorx:Key="cButtonBackground">#c5c7c4</Color>
<Colorx:Key="cButtonText">#000</Color>
<Colorx:Key="cSecondaryButtonBackground">#303030</Color>
<Colorx:Key="cSecondaryButtonText">#ffffff</Color>
<Colorx:Key="cDisabledButtonBackground">#ddd</Color>
<Colorx:Key="cDisabledButtonText">#888</Color>
<Colorx:Key="cPressedButtonBackground">#ddd</Color>
<Colorx:Key="cPressedButtonText">#000</Color>
<!-- Other colors go here -->
</ResourceDictionary>
LightTheme.xaml.cs
using Xamarin.Forms;using Xamarin.Forms.Xaml;namespaceMyMobileThemes{[XamlCompilation(XamlCompilationOptions.Compile)]publicpartialclassLightTheme:ResourceDictionary{publicLightTheme(){
InitializeComponent();}}}
using Xamarin.Forms;using Xamarin.Forms.Xaml;namespaceMyMobileThemes{[XamlCompilation(XamlCompilationOptions.Compile)]publicpartialclassControlStyles:ResourceDictionary{publicControlStyles(){
InitializeComponent();}}}
Microsoft Visual Studio Professional 2022
Version 17.0.5
VisualStudio.17.Release/17.0.5+32112.339
Microsoft .NET Framework
Version 4.8.04084
Installed Version: Professional
Visual C++ 2022 00476-80000-00000-AA342
Microsoft Visual C++ 2022
.NET Core Debugging with WSL 1.0
.NET Core Debugging with WSL
ASP.NET and Web Tools 2019 17.0.795.42246
ASP.NET and Web Tools 2019
ASP.NET Web Frameworks and Tools 2019 17.0.795.42246
For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0 17.0.795.42246
Azure App Service Tools v3.0.0
Azure Functions and Web Jobs Tools 17.0.795.42246
Azure Functions and Web Jobs Tools
C# Tools 4.0.1-1.21568.1+6ab6601178d9fba8c680b56934cd1742e0816bff
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Extensibility Message Bus 1.2.6 (master@34d6af2)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager 2.1.134+45632ee938.RR
Install client-side libraries easily to any web project
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards
Microsoft Visual Studio Tools for Containers 1.2
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package
Mono Debugging for Visual Studio 17.0.11 (54f19d2)
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 6.0.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
Razor (ASP.NET Core) 17.0.0.2156603+e9cd763349a080127b6519ffbec0123949a4c385
Provides languages services for ASP.NET Core Razor.
SQL Server Data Tools 17.0.62110.20190
Microsoft SQL Server Data Tools
StylerPackage Extension 1.0
StylerPackage Visual Stuido Extension Detailed Info
TypeScript Tools 17.0.1001.2002
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 4.0.1-1.21568.1+6ab6601178d9fba8c680b56934cd1742e0816bff
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 17.0.0-beta.21522.2+6d626ff0752a77d339f609b4d361787dc9ca93a5
Microsoft Visual F# Tools
Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Container Tools Extensions 1.0
View, manage, and diagnose containers within Visual Studio.
Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.
Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers
VisualStudio.DeviceLog 1.0
Information about my package
VisualStudio.Foo 1.0
Information about my package
VisualStudio.Mac 1.0
Mac Extension for Visual Studio
WiX Toolset Visual Studio Extension 1.0.0.18
WiX Toolset Visual Studio Extension version 1.0.0.18
Copyright (c) .NET Foundation and contributors. All rights reserved.
Xamarin 17.0.0.343 (d17-0@fb07a17)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 17.0.0.183 (remotes/origin/d17-0@a351f0f1f)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 17.0.17 (9e779b0)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK 12.1.0.5 (d17-0/6b0e6b2)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: c633fe9
Java.Interop: xamarin/java.interop/d17-0@febb1367
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.36.0@a575761
Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-0@a5194e9
Xamarin.iOS and Xamarin.Mac SDK 15.4.0.0 (8fc41ae82)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
The text was updated successfully, but these errors were encountered:
Description
This is more of a question than a bug report, I'm sorry if this isn't the right place to post it.
I wanted to separate my Xamarin app styling to a separate class library so it can be reused in other apps (light and dark theme, control styles, etc). However, the issue I'm running into is that when the class library is installed (via private nuget feed) and used in Xamarin apps, the Intellisense doesn't work for any of the color resources (it works for styles).
Is there a way to fix this? How can I tell my class library that the ResourceDictionaries it contains need to be present at design time for Intellisense to work?
Steps to Reproduce
The class library containing the resources
MyMobileThemes.csproj
LightTheme.xaml
LightTheme.xaml.cs
ControlStyles.xaml
ControlStyles.xaml.cs
Consuming the library in Xamarin apps
SampleApp.csproj
App.xaml
Expected Behavior
Intellisense works for all the resources when using the library in another Xamarin.Forms app.
Actual Behavior
Intellisense only works for styles, but not for any of the colors.
Intellisense works for this:
Intellisense doesn't work for this
Basic Information
Environment
Show/Hide Visual Studio info
The text was updated successfully, but these errors were encountered: