Hello.
Is any way to use common resource file in Silverlight and .Net project?
I try to make link to Silverlight resources but different namespaces not allows ResourceManager to get resources from assembly.
Do you have any ideas?
Hello.
Is any way to use common resource file in Silverlight and .Net project?
I try to make link to Silverlight resources but different namespaces not allows ResourceManager to get resources from assembly.
Do you have any ideas?
You can share a resource file between a Silverlight application and .NET application through a Silverlight Class Library. Simply add your resource file to the Silverlight Class Library and reference the project in your Silverlight application and .NET application.
Once you have done this, you can reference the resource file as follows:
Example ASP.NET application:
using System;
using System.Collections.Generic;
using System.Linq;
using SilverlightClassLibrary1;
namespace SilverlightApplication2.Web
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(MyResources.String1);
}
}
}
Example Silverlight Application:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;
using SilverlightClassLibrary1;
namespace SilverlightApplication2
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
txtName.Text = MyResources.String1;
}
}
}