2014-09-25 1 views
0

윈도우 폰 8.1 앱을 개발 중입니다. 페이지 전체에 공유 된 앱 표시 줄을 사용했습니다. 언젠가 글로벌 앱 표시 줄의 아이콘이나 아이콘을 변경해야합니다. 이것이 가능한가?윈도우 폰 8.1의 공유 앱 바 레이블을 바꾸는 방법 8.1

귀하의 생각이 도움이 될 것입니다.

var commandBar = Application.Current.Resources["YouResourceKeyForAppBar"] as AppBar; 

이제에 대한 참조를 가지고 있고 그 안에 항목을 수정할 수 있습니다 다음과 같은 코드를 통해 액세스 할 수있는 것보다 당신이 자료에 앱 줄을 저장하는 경우

+0

어떻게 공유 Appbar를 구현 했습니까? –

+0

@IgorKulman이 [link] (http://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj150604.aspx) 다음에 파쇄 된 응용 프로그램 막대를 구현했습니다. – user3736911

답변

0
public MainPage() 

{this.InitializeComponent();

Loaded += MainPage_Loaded; 
} 

void MainPage_Loaded(object sender, RoutedEventArgs e) 
{ 
CommandBar bottomCommandBar = this.BottomAppBar as CommandBar; 
AppBarButton appbarButton_0 = bottomCommandBar.PrimaryCommands[0] as AppBarButton; 
appbarButton_0.Label = "settings"; 
appbarButton_0.Icon = new SymbolIcon(Symbol.Setting); 
} 
+0

괜찮 았는데 .. 도와 줘서 고마워 !! !! – user3736911

0

. 다른 방법으로 SharedApp을 구현 한 경우 질문을 편집하고 이에 대한 자세한 정보를 제공하십시오. WP8.1에서

0

BottomAppBar이 당신이 아마 AppBarButtons을 보유하고있는 PrimaryCommands property을 발견 할 것이다, CommandBar입니다. 당신은 예를 들어 변경하려는 경우 라벨 (아이콘 또는 다른 것), 당신이 이런 식으로 일을 할 수 있어야한다 : 당신은 종종 AppBarButton의 매개 변수를 변경하려면

// change the label of the first button 
((BottomAppBar as CommandBar).PrimaryCommands[0] as AppBarButton).Label = "New Label"; 

, 쉽게 만들려면 , 당신은 간단한 확장 방법을 쓸 수 있습니다 :

는 상기와 동일하지만 만드는 물론
/// <summary> 
/// Get AppBarButton of AppBar - extension method 
/// </summary> 
/// <param name="index">index of target AppBarButton</param> 
/// <returns>AppBarButton of desired index</returns> 
public static AppBarButton PButton(this AppBar appBar, int index) { return (appBar as CommandBar).PrimaryCommands[index] as AppBarButton; } 

쉽게 거의 사용 :

BottomAppBar.PButton(0).Label = "New label"; 
0

아마도 나는 Windows.UI.ViewManagement 공간 즉 StatusBarApplicationView의 제목에서 8.1 라이브러리에 대한 대체 솔루션 덕분에 제안 할 수

그것은이 상황을 도움이되지 않습니다,하지만 찾고 서로에 대한 간단한 일을 할 수 이 게시물에. 불행하게도, 당신이 여기까지 설정 할 수 있습니다 유일한 것은 제목

await statusBar.ProgressIndicator.ShowAsync(); 
await statusBar.ProgressIndicator.HideAsync(); 

입니다 :

var titleName = "TITLE"; 

var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView(); 
statusBar.ProgressIndicator.Text = titleName; 

var applicationView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView(); 
applicationView.Title = titleName; 

그런 다음에 컨트롤을 표시하고 숨길 수 있습니다. StatusBar에 사용자 지정 스타일을 설정할 수 있다고 생각하지 않습니다.