I am having a bit of a hard time providing localized strings for the UI in a small Silverlight 4 application. Basically I've put a folder "Resources" and placed two resource files in it :
Statuses.resx
Statuses.ro.resx
I do have an enum Statuses :
public enum Statuses
{
None,
Working
}
and a convertor :
public class StatusToMessage : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!Enum.IsDefined(typeof(Status), value))
{
throw new ArgumentOutOfRangeException("value");
}
var x = Statuses.None;
return Statuses.ResourceManager.GetString(((Status)value).ToString(), Thread.CurrentThread.CurrentUICulture);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
in the view I have a textblock :
<TextBlock Grid.Column="3" Text="{Binding Status, Converter={StaticResource StatusToMessage}}" />
Upon view rendering the converter is called but no matter what the Thread.CurrentThread.CurrentUICulture is set it always returns the default culture value.
Upon further inspection I took apart the XAP resulted file, taken the resulted DLL file to Reflector and inspected the embedded resources. It only contains the default resource!!
Going back to the two resource files I am now inspecting their properties :
Build action : Embedded Resource
Copy to output directory : Do not copy
Custom tool : ResXFileCodeGenerator
Custom tool namespace : [empty]
Both resource (.resx) files have these settings. The .Designer.cs resulted files are as follows :
Statuses.Designer.cs :
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SilverlightApplication5.Resources {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Statuses {
// ... yadda-yadda
Statuses.ro.Designer.cs
[empty]
I've taken both files and put them in a console application and they behave as expected in it, not like in this silverlight application.
What is wrong?
I am trying to detect double taps on a view, but when the double tap comes, the first tap triggers an action on TouchesBegan, so, before detecting a double tap a single tap is always detected first.
How can I make this in a way that just detects the double tap?
I cannot use OS 3.x gestures, because I have to make it compatible with old OS versions.
thanks
Hey,
I am searching for a good mode to develop a application which shows 7 days and 24 hours (weekly view), knows somebody if there is a good tutorial? Or which layout would you use to design this?
It should be possible to add events with a beginning and ending time...
Thanks in advance
Johannes
i would like know some reference. I know i can googling it. but prefer from your point of view and your understanding what is the basic one...thanks ;D
i have a rhel 4 server and use php as a server side scripting language. There are many doc and excel files that are uploaded to the server daily. i make these files to be downloaded. i want to implement the view as html feature and they should preserve the formatting also. so which tools can be used or it can be done through php only. (on php4)
I have 5 links that are on the same form but I would like them all to reference the same AJAX modalpopup extender. I am basically showing a panel with the same view layout with just different data depending on which link is pressed, showing different match scores from games.
The only way I can get it to work is have 5 panels with unique names and each link references its own panel.
Can I get all the links to call one panel?
Thanks
I'm trying to use a custom sort with a ListView, as described in this blog entry.
I'm doing
ListCollectionView view = (ListCollectionView)CollectionViewSource.GetDefaultView(TheList.ItemsSource);
as recommended there and in several other places, but for some reason I'm getting "Unable to cast object of type 'MS.Internal.Data.EnumerableCollectionView' to type 'System.Windows.Data.ListCollectionView'." (TheList is of type ListView).
What could be causing this?
This error
Thu Apr 8 20:24:15 iPod-touch appname[947] <Error>: Error: Embedded profile header length is greater than data length.\n
Thu Apr 8 20:24:16 iPod-touch appname[947] <Error>: Error: Embedded profile header length is greater than data length.\n
is logged when a UIImageView is loaded. The view isn't huge but it has a few other UIImageViews as subviews and it might be related to memory, but I can't find anything on this message. Any ideas?
I'm trying to format an UITextField as user types text, for instance to show separator for thousands.
I found this web page : http://www.iphonedevsdk.com/forum/iphone-sdk-development/16512-trying-add-commas.html
It seems that shouldChangeCharactersInRange: is not a good solution. I thought of a custom UIView where the view would be updated as the user types digits, yet it would require recreating the wheel...
I assumed that the correct way to preselect a cell in a table view was:
- (void)selectRowAtIndexPath:(NSIndexPath *)indexPath
animated:(BOOL)animated
scrollPosition:(UITableViewScrollPosition)scrollPosition
However it does absolutely nothing. Nadda.
For context I am building an iPad app and the tableview is deployed from a Popover ViewController. So the tableView is only visible when deployed. I am currently calling the above method in:
- (void)viewDidAppear:(BOOL)animated;
Any thoughts?
Thanks,
Doug
I am trying to create a datepicker using a different locale than English. According to the jQuery manual I need to add the line:
$("#datepicker").datepicker($.datepicker.regional['fr']);
to $view->jquery()->addOnLoad(). The code is output and runs without any errors, but the month and day names are still in English.
Is there some simpler option or what am I overlooking.
I have a page that uses a background image to do rounded corners, and in IE8 on Windows XP the background image repeats.
http://j.mp/c5h1Hf
It looks right in other browsers and even in "Compatability View" in IE8.
Does anyone know how to remove the repetion? I'm stumped!
I have a large website in development with a large amount of JS in different files. I have come across an issue where something is removing a class from the DOM. I can see it when I view source but not in Firebug.
Normally I would place some alerts/console.log calls with the hasClass value but because I have no idea where to start I wanted to know if I can trace the change back when it occurs somehow?
Denis
Hi All,
I'm using Blueprint as my CSS framework in my rails project. But currently i'm having a problem as when i created a link
it shows both the link and display text in the web page
Ex : say i have
'go to google'
in my web page (view) it shows both
"go to google (http://www.google.com)" where as i want to show only 'go to google'
can someone tell me how to fix this,
thanks in advance
cheers,
sameera
Okay, i have a number of pins on the mapkit. These pins showing different types of attractions. (E.g Parks, Farms and etc)
I want to add custom images for these different types of pin. Parks have a park image and vice versa.
However, when i added in, not all the images are showing successfully. For example, in parks, it should have 5 pins, but the image only came up in 2 pins, whereas other 3 is in default red pins.
But if i used colours to differentiate them.
For example, [pinsetPinColor:MKPinAnnotationColorGreen];
It works! Anyone knows what is the problem?
Relevant codes below. Tell me if you need more. thanks!
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{
if ([annotation isKindOfClass:MKUserLocation.class]) {
//user location view is being requested,
//return nil so it uses the default which is a blue dot...
return nil;
}
//NSLog(@"View for Annotation is called");
MKPinAnnotationView *pin=[[MKPinAnnotationView alloc]
initWithAnnotation:annotation reuseIdentifier:nil];
pin.userInteractionEnabled=TRUE;
MapEvent* event = (MapEvent*)annotation;
NSLog(@"thetype: %@", event.thetype);
if ([event.thetype isEqualToString:@"adv"]) {
//[pin setPinColor:MKPinAnnotationColorGreen];
pin.image = [UIImage imageNamed:@"padv.png"];
}
else if ([event.thetype isEqualToString:@"muse"]){
//[pin setPinColor:MKPinAnnotationColorPurple];
pin.image = [UIImage imageNamed:@"pmuse.png"];
}
else if ([event.thetype isEqualToString:@"nightlife"]){
pin.image = [UIImage imageNamed:@"pnight.png"];
}
else if ([event.thetype isEqualToString:@"parks"]){
pin.image = [UIImage imageNamed:@"ppark.png"];
}
else if ([event.thetype isEqualToString:@"farms"]){
pin.image = [UIImage imageNamed:@"pfarm.png"];
}
else {
[pin setPinColor:MKPinAnnotationColorRed];
}
pin.canShowCallout = YES;
pin.animatesDrop = YES;
UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton addTarget:self action:@selector(clickAnnotation:) forControlEvents:UIControlEventTouchUpInside];
[rightButton setTitle:event.uniqueID forState:UIControlStateNormal];
pin.rightCalloutAccessoryView = rightButton;
return pin;
}
Hello, I have map (openstreetmap project) with many buildings. Each building is a polygon. How can I make saddle roof parts polygons for every building outline?
Algorithm should transform one polygon in 2D to set of polygons in 2D (or 3D).
Reason for this transformation is visualization - better rendering isometric view.
For example (shading isn't important):
Thanks
i need to know how to pass everything after the .php part in this link
"http://wreckedclothing.net/help/[email protected]&t=985559"
to a iframe on the same page. "hosted on the same site"
like this
"<iframe>
src="http://www.wreckedclothing.net/[email protected]&t=985559"
frameborder="0"
width="829"
name="tree"></iframe>
see how it adds everything to the link in src
In my source code I have some lines like NSLocalizedStringFromTable(@"Info", @"en", @"Title of this view"). When I subsequently call genstrings -o en.lproj ./Classes/*.m I would not get the expected file en.strings but Localized.strings, although I've read in the genstrings-manpage that it would generate a table.strings file from NSLocalizedStringFromTable(a, table, c) function. Am I wrong? How would I create a table.strings file then?
How can I popview from back button pressed, i passed the below code from previous view controller. Thanks
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc]
initWithTitle:@"Back"
style:UIBarButtonItemStyleBordered
target:nil action:nil];
Hi all,
can I integrate the jasper report viewer to my swing application as like if I click on view report button from my application then viewer should be opened. If so could you advice me with code snippet for this integration and in this viewer the save as type should be restricted for PDF only rather than every other download option filter available .
Please advice me in this regard.
Regards,
Chandu
Hi, I'm new to codeigniter this is my case:
I have a homepage with a list of items, I can navigate through pagination, but I have in my sidebar a login form, it's possible to return to the same page after try to login in the case that is valid or not with a validation message.
for the login option I have a controller and login function but I don't know what view load after validation.
I need to login in any controller and return to the same url.
thanks
I have a Django form setup using GET method. Each value corresponds to attributes of a Django model. What would be the most elegant way to generate the query? Currently this is what I do in the view:
def search_items(request):
if 'search_name' in request.GET:
query_attributes = {}
query_attributes['color'] = request.GET.get('color', '')
if not query_attributes['color']: del query_attributes['color']
query_attributes['shape'] = request.GET.get('shape', '')
if not query_attributes['shape']: del query_attributes['shape']
items = Items.objects.filter(**query_attributes)
But I'm pretty sure there's a better way to go about it.
Does anyone have the same problem as I do? ... I've upgraded to the iPhone SDK 3.2 and I am unable to resize UITableViewCell object in my XIB file (usually I've been just resizing the view but now the cell has the same size and there is just a grey are around) ... btw, I've tried to reinstall twice including one deep reinstall.