我正在使用Intense模板制作UWP应用程序,问题是我无法使Share工作,因为我不知道如何使用此模板从app.xaml.cs导航。< / p>
class ApplicationController < ActionController::Base
include PublicActivity::StoreController
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
skip_before_filter :verify_authenticity_token
helper_method :mailbox, :conversation
before_action :set_last_seen_at, if: proc { user_signed_in? }
before_action :notification, if: proc { user_signed_in? }
private
def mailbox
@mailbox ||= current_user.mailbox
end
def conversation
@conversation ||= mailbox.conversations.find(params[:id])
end
def set_last_seen_at
current_user.update_attribute(:last_seen_at, Time.now)
end
def notification
@shipment_ids = Shipment.where(:user_id => current_user.id).pluck(:id)
@comment = Comment.where("shipment_id IN (?)", @shipment_ids).where(:is_read => false).where.not(:user_id => current_user.id)
end
end
答案 0 :(得分:0)
您可以获取Microsoft源代码来检索Frame
对象
private Frame CreateRootFrame()
{
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
return rootFrame;
}
并按照你想要的方式使用
protected override void OnShareTargetActivated(ShareTargetActivatedEventArgs args)
{
var rootFrame = CreateRootFrame();
// your page and share operation as navigation parameters
rootFrame.Navigate(typeof(ShareTargetPage), args.ShareOperation);
Window.Current.Activate();
}