resources

Add font family in resourceDictionary

百般思念 提交于 2019-12-22 09:25:47
问题 I am using the msdn tutorial to add a FontFamily in my Wpf application, in .csproj I have : <ItemGroup> <Resource Include="Resources\MetaOT-Norm.otf" /> <Resource Include="Resources\MetaOT-Bold.otf" /> </ItemGroup> I added the fontfamily in the ResourceDictionary, like that : <FontFamily x:Key="FontMetaOT">./Resources/#Meta OT</FontFamily> But it's not applied... (I have tried with the Font files in the windows Fonts directory and it's work well). Any idea ? 回答1: If you are using a resource

Embedded Binary Resources - how can I enumerate the image files embedded?

戏子无情 提交于 2019-12-22 09:14:18
问题 I was following the instructions in this book, chapter on Resources etc. and what I can't quite figure out is, how do I replace this: images.Add(new BitmapImage(new Uri(@"/Images/Deer.jpg", UriKind.Relative))); images.Add(new BitmapImage(new Uri(@"/Images/Dogs.jpg", UriKind.Relative))); images.Add(new BitmapImage(new Uri(@"/Images/Welcome.jpg", UriKind.Relative))); by a loop that would simply run through all embedded image resources to avoid hard-coding the image names and paths. How would I

Embedded Binary Resources - how can I enumerate the image files embedded?

旧街凉风 提交于 2019-12-22 09:13:55
问题 I was following the instructions in this book, chapter on Resources etc. and what I can't quite figure out is, how do I replace this: images.Add(new BitmapImage(new Uri(@"/Images/Deer.jpg", UriKind.Relative))); images.Add(new BitmapImage(new Uri(@"/Images/Dogs.jpg", UriKind.Relative))); images.Add(new BitmapImage(new Uri(@"/Images/Welcome.jpg", UriKind.Relative))); by a loop that would simply run through all embedded image resources to avoid hard-coding the image names and paths. How would I

MVC3 Localized display name attribute by property name

余生颓废 提交于 2019-12-22 08:40:16
问题 I have recently learned how to create a localized display names for my model's properties using the following article: Simplified localization for DataAnnotations And I am now trying to push it a bit further by removing the parameters from the constructor. Meaning instead of having this public class User { [Required] [LocalizedDisplayNameAttribute("User_Id")] public int Id { get; set; } [Required] [StringLength(40)] [LocalizedDisplayNameAttribute("User_FirstName")] public string FirstName {

ResourceType (Skipping entry in package table) problem

六眼飞鱼酱① 提交于 2019-12-22 08:39:03
问题 In debugger I am getting this warning (5 times): W 2265 ResourceType Skipping entry 0x106000d in package table 0 because it is not complex! These warnings show every time an activity is brought to the front. I have checked R.java and there is no resource with this address 0x106000d. I have no idea what to do. 回答1: It is a warning. Unless you are experiencing concrete problems that you are certain relate to this, ignore it. The operating system logs all sorts of stuff that we as developers

WPF: Can't instantiate class in Window.Resources

﹥>﹥吖頭↗ 提交于 2019-12-22 08:36:28
问题 I'm doing this WPF tutorial and for some reason I get an error when adding a custom SlidersToColorConverter class to resources. Someone on StackOverflow was doing it exact same way. MainWindow.xaml : <Window x:Class="WpfApplication2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplication2" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <local

App install size the same on different device types

北战南征 提交于 2019-12-22 05:26:32
问题 When I install my app on my main/new phone, the installed size is around 18.5MB and when I install my app on an old Samsung Galaxy Ace (Mk1), for some reason, it installs with pretty much the same size, as you see here: It runs perfectly on my main phone, but obviously, the old Galaxy Ace really struggles with it. Now, I download a random game from the Play Store and with that one you can see the results here: Much better, it takes up less space on the less capable phone than it does on the

Eclipse Android won't clean, won't refresh resources

这一生的挚爱 提交于 2019-12-22 05:20:05
问题 I upgraded to Ubuntu 11.10, Eclipse 3.7.0, ADT 14.0.0. When I replaced a picture resource in the /res/drawable-nodpi directory on the desktop, or a sound resource in the /res/raw directory, both the recompiled program and the Project Explorer use some previously cached version. I tried the following, none of which worked: right-click on filename in project explorer: Refresh right-click on /drawable-nodpi dir in p.e.: Refresh right-click on /res dir in p.e.: Refresh right-click on Project in p

Text with shapes in drawable resource

为君一笑 提交于 2019-12-22 03:35:09
问题 Can i create text-shape in drawable resource? I was googling much but found nothing... Here is my drawable file: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="oval"> <stroke android:width="3dp" android:color="#QQffQQ"/> <size android:width="120dp" android:height="120dp"/> </shape> </item> <item android:right="59dp" android:left="59dp"> <shape android:shape="rectangle"> <solid android:color="£22££20"/

Delphi 2010: unable to find resource - EResNotFound

做~自己de王妃 提交于 2019-12-22 01:22:33
问题 Based on examples at for instance here, here, and here, I'm trying to include SVN revision info in a project. The result of a svn info call is stored in rev.txt (it's a plain ansi file). My revinfo.rc looks like this: REV_TEXT TEXT rev.txt My project looks like this: unit rev; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm2 = class(TForm) Memo1: TMemo; Button1: TButton; procedure Button1Click(Sender: TObject); end; var